aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@linux-foundation.org>2007-07-01 12:50:35 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-01 14:08:39 -0400
commit0f4915b9c5d7a35da11bfcff80ae6466cb7b9fc4 (patch)
treed827b3da44f54cfeaffa81a34fb9774bf04d71b6 /drivers/misc
parent4710bcce8e02257c8a423b7a62ea81d0207582c8 (diff)
blink driver power saving
The blink driver wakes up every jiffies which wastes power unnecessarily. Using a notifier gives same effect. Also add ability to unload module. Signed-off-by: Stephen Hemminger <shemminger@linux-foundation.org> [ We should really just delete the whole thing. The blink driver is broken in many other ways too -Linus ] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/blink.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/drivers/misc/blink.c b/drivers/misc/blink.c
index 634431ce1184..97f7253ce2d3 100644
--- a/drivers/misc/blink.c
+++ b/drivers/misc/blink.c
@@ -16,12 +16,30 @@ static void do_blink(unsigned long data)
16 add_timer(&blink_timer); 16 add_timer(&blink_timer);
17} 17}
18 18
19static int blink_init(void) 19static int blink_panic_event(struct notifier_block *blk,
20 unsigned long event, void *arg)
20{ 21{
21 printk(KERN_INFO "Enabling keyboard blinking\n");
22 do_blink(0); 22 do_blink(0);
23 return 0; 23 return 0;
24} 24}
25 25
26static struct notifier_block blink_notify = {
27 .notifier_call = blink_panic_event,
28};
29
30static __init int blink_init(void)
31{
32 printk(KERN_INFO "Enabling keyboard blinking\n");
33 atomic_notifier_chain_register(&panic_notifier_list, &blink_notify);
34 return 0;
35}
36
37static __exit void blink_remove(void)
38{
39 del_timer_sync(&blink_timer);
40 atomic_notifier_chain_unregister(&panic_notifier_list, &blink_notify);
41}
42
26module_init(blink_init); 43module_init(blink_init);
44module_exit(blink_remove);
27 45