From 71a5fd7d89fb6e6071f041ba1b55837837ccddb8 Mon Sep 17 00:00:00 2001 From: Max Filippov Date: Tue, 6 Jun 2023 17:43:47 -0700 Subject: xtensa: drop platform_heartbeat platform_heartbeat is called from the timer interrupt handler, but there may be no periodic timer interrupts on xtensa, so the frequency of platform_heartbeat calls may be unrelated to HZ. Drop the callback and reimplement its only user with a timer. Signed-off-by: Max Filippov --- arch/xtensa/platforms/xt2000/setup.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'arch/xtensa/platforms') diff --git a/arch/xtensa/platforms/xt2000/setup.c b/arch/xtensa/platforms/xt2000/setup.c index 08bc9b0ede3e..dc187684203b 100644 --- a/arch/xtensa/platforms/xt2000/setup.c +++ b/arch/xtensa/platforms/xt2000/setup.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -70,16 +71,17 @@ void __init platform_setup(char** cmdline) /* Heartbeat. Let the LED blink. */ -void platform_heartbeat(void) +static void xt2000_heartbeat(struct timer_list *unused); + +static DEFINE_TIMER(heartbeat_timer, xt2000_heartbeat); + +static void xt2000_heartbeat(struct timer_list *unused) { - static int i, t; + static int i; - if (--t < 0) - { - t = 59; - led_print(7, i ? ".": " "); - i ^= 1; - } + led_print(7, i ? "." : " "); + i ^= 1; + mod_timer(&heartbeat_timer, jiffies + HZ / 2); } //#define RS_TABLE_SIZE 2 @@ -137,7 +139,7 @@ static int __init xt2000_setup_devinit(void) { platform_device_register(&xt2000_serial8250_device); platform_device_register(&xt2000_sonic_device); - + mod_timer(&heartbeat_timer, jiffies + HZ / 2); return 0; } -- cgit v1.2.3-70-g09d2