From 32ec0466cfd9905593137e230c492c4d3f0f346f Mon Sep 17 00:00:00 2001 From: Alexander Holler Date: Thu, 3 May 2012 15:44:27 +1000 Subject: [PATCH] leds-heartbeat-stop-on-shutdown-v5 Signed-off-by: Alexander Holler Cc: Shuah Khan Cc: Richard Purdie Signed-off-by: Andrew Morton --- drivers/leds/ledtrig-heartbeat.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/leds/ledtrig-heartbeat.c b/drivers/leds/ledtrig-heartbeat.c index 8ec5fecf577f..02fef0383a7a 100644 --- a/drivers/leds/ledtrig-heartbeat.c +++ b/drivers/leds/ledtrig-heartbeat.c @@ -115,17 +115,26 @@ static struct notifier_block heartbeat_reboot_nb = { .notifier_call = heartbeat_reboot_notifier, }; +static struct notifier_block heartbeat_panic_nb = { + .notifier_call = heartbeat_reboot_notifier, +}; + static int __init heartbeat_trig_init(void) { int rc = led_trigger_register(&heartbeat_led_trigger); - if( ! rc ) + if (!rc) { + atomic_notifier_chain_register(&panic_notifier_list, + &heartbeat_panic_nb); register_reboot_notifier(&heartbeat_reboot_nb); + } return rc; } static void __exit heartbeat_trig_exit(void) { unregister_reboot_notifier(&heartbeat_reboot_nb); + atomic_notifier_chain_unregister(&panic_notifier_list, + &heartbeat_panic_nb); led_trigger_unregister(&heartbeat_led_trigger); } -- 2.39.5