Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'fixes-for-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds

Pull leds fix from Bryan Wu:
"Fix for heartbeat led trigger driver"

* 'fixes-for-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds:
leds: heartbeat: fix bug on panic

+15 -1
+15 -1
drivers/leds/ledtrig-heartbeat.c
··· 21 21 #include <linux/reboot.h> 22 22 #include "leds.h" 23 23 24 + static int panic_heartbeats; 25 + 24 26 struct heartbeat_trig_data { 25 27 unsigned int phase; 26 28 unsigned int period; ··· 35 33 struct heartbeat_trig_data *heartbeat_data = led_cdev->trigger_data; 36 34 unsigned long brightness = LED_OFF; 37 35 unsigned long delay = 0; 36 + 37 + if (unlikely(panic_heartbeats)) { 38 + led_set_brightness(led_cdev, LED_OFF); 39 + return; 40 + } 38 41 39 42 /* acts like an actual heart beat -- ie thump-thump-pause... */ 40 43 switch (heartbeat_data->phase) { ··· 118 111 return NOTIFY_DONE; 119 112 } 120 113 114 + static int heartbeat_panic_notifier(struct notifier_block *nb, 115 + unsigned long code, void *unused) 116 + { 117 + panic_heartbeats = 1; 118 + return NOTIFY_DONE; 119 + } 120 + 121 121 static struct notifier_block heartbeat_reboot_nb = { 122 122 .notifier_call = heartbeat_reboot_notifier, 123 123 }; 124 124 125 125 static struct notifier_block heartbeat_panic_nb = { 126 - .notifier_call = heartbeat_reboot_notifier, 126 + .notifier_call = heartbeat_panic_notifier, 127 127 }; 128 128 129 129 static int __init heartbeat_trig_init(void)