From 7a779a8d09234d1be1a85b3a49287d0512f24419 Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Tue, 28 May 2024 13:13:19 +0200 Subject: [PATCH] m68k: remove dead code 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 Cc: Angelo Dureghello Signed-off-by: Rasmus Villemoes Reviewed-by: Stefan Roese --- 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 6bfde5e9bd..d0a0a4500a 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.39.5