[PATCH 1/7] m68k: remove dead code
Rasmus Villemoes
rasmus.villemoes at prevas.dk
Tue May 28 13:13:19 CEST 2024
There are no calls of "watchdog_reset()" anymore anywhere in the tree
since the WATCHDOG_RESET macro got removed in 942d07df0e79 ("watchdog:
Remove WATCHDOG_RESET macro").
The only places the identifiers watchdog_disable and watchdog_init are
called are in arch/arm/mach-omap2/, so those can obviously not refer
to these instances.
Hence these functions are not actually used at all and can be
removed. As a bonus, this also removes two leftover references to
WATCHDOG_RESET.
Cc: Huan Wang <alison.wang at nxp.com>
Cc: Angelo Dureghello <angelo at kernel-space.org>
Signed-off-by: Rasmus Villemoes <rasmus.villemoes at prevas.dk>
---
arch/m68k/cpu/mcf52x2/cpu.c | 108 ------------------------------------
1 file changed, 108 deletions(-)
diff --git a/arch/m68k/cpu/mcf52x2/cpu.c b/arch/m68k/cpu/mcf52x2/cpu.c
index 6bfde5e9bd7..d0a0a4500a9 100644
--- a/arch/m68k/cpu/mcf52x2/cpu.c
+++ b/arch/m68k/cpu/mcf52x2/cpu.c
@@ -108,26 +108,6 @@ int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
return 0;
};
-#if defined(CONFIG_WATCHDOG)
-void watchdog_reset(void)
-{
- mbar_writeShort(MCF_WTM_WSR, 0x5555);
- mbar_writeShort(MCF_WTM_WSR, 0xAAAA);
-}
-
-int watchdog_disable(void)
-{
- mbar_writeShort(MCF_WTM_WCR, 0);
- return (0);
-}
-
-int watchdog_init(void)
-{
- mbar_writeShort(MCF_WTM_WCR, MCF_WTM_WCR_EN);
- return (0);
-}
-#endif /* #ifdef CONFIG_WATCHDOG */
-
#endif
#ifdef CONFIG_M5272
@@ -174,49 +154,6 @@ int print_cpuinfo(void)
};
#endif /* CONFIG_DISPLAY_CPUINFO */
-#if defined(CONFIG_WATCHDOG)
-/* Called by macro WATCHDOG_RESET */
-void watchdog_reset(void)
-{
- wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
-
- out_be16(&wdt->wdog_wcr, 0);
-}
-
-int watchdog_disable(void)
-{
- wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
-
- /* reset watchdog counter */
- out_be16(&wdt->wdog_wcr, 0);
- /* disable watchdog interrupt */
- out_be16(&wdt->wdog_wirr, 0);
- /* disable watchdog timer */
- out_be16(&wdt->wdog_wrrr, 0);
-
- puts("WATCHDOG:disabled\n");
- return (0);
-}
-
-int watchdog_init(void)
-{
- wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
-
- /* disable watchdog interrupt */
- out_be16(&wdt->wdog_wirr, 0);
-
- /* set timeout and enable watchdog */
- out_be16(&wdt->wdog_wrrr,
- (CONFIG_WATCHDOG_TIMEOUT_MSECS * CONFIG_SYS_HZ) / (32768 * 1000) - 1);
-
- /* reset watchdog counter */
- out_be16(&wdt->wdog_wcr, 0);
-
- puts("WATCHDOG:enabled\n");
- return (0);
-}
-#endif /* #ifdef CONFIG_WATCHDOG */
-
#endif /* #ifdef CONFIG_M5272 */
#ifdef CONFIG_M5275
@@ -243,51 +180,6 @@ int print_cpuinfo(void)
};
#endif /* CONFIG_DISPLAY_CPUINFO */
-#if defined(CONFIG_WATCHDOG)
-/* Called by macro WATCHDOG_RESET */
-void watchdog_reset(void)
-{
- wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
-
- out_be16(&wdt->wsr, 0x5555);
- out_be16(&wdt->wsr, 0xaaaa);
-}
-
-int watchdog_disable(void)
-{
- wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
-
- /* reset watchdog counter */
- out_be16(&wdt->wsr, 0x5555);
- out_be16(&wdt->wsr, 0xaaaa);
-
- /* disable watchdog timer */
- out_be16(&wdt->wcr, 0);
-
- puts("WATCHDOG:disabled\n");
- return (0);
-}
-
-int watchdog_init(void)
-{
- wdog_t *wdt = (wdog_t *)(MMAP_WDOG);
-
- /* disable watchdog */
- out_be16(&wdt->wcr, 0);
-
- /* set timeout and enable watchdog */
- out_be16(&wdt->wmr,
- (CONFIG_WATCHDOG_TIMEOUT_MSECS * CONFIG_SYS_HZ) / (32768 * 1000) - 1);
-
- /* reset watchdog counter */
- out_be16(&wdt->wsr, 0x5555);
- out_be16(&wdt->wsr, 0xaaaa);
-
- puts("WATCHDOG:enabled\n");
- return (0);
-}
-#endif /* #ifdef CONFIG_WATCHDOG */
-
#endif /* #ifdef CONFIG_M5275 */
#ifdef CONFIG_M5282
--
2.40.1.1.g1c60b9335d
More information about the U-Boot
mailing list