diff options
Diffstat (limited to 'drivers/parisc/led.c')
-rw-r--r-- | drivers/parisc/led.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c index 454b6532e409..9581d3619450 100644 --- a/drivers/parisc/led.c +++ b/drivers/parisc/led.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * (c) Copyright 2000 Red Hat Software | 4 | * (c) Copyright 2000 Red Hat Software |
5 | * (c) Copyright 2000 Helge Deller <hdeller@redhat.com> | 5 | * (c) Copyright 2000 Helge Deller <hdeller@redhat.com> |
6 | * (c) Copyright 2001-2005 Helge Deller <deller@gmx.de> | 6 | * (c) Copyright 2001-2009 Helge Deller <deller@gmx.de> |
7 | * (c) Copyright 2001 Randolph Chung <tausq@debian.org> | 7 | * (c) Copyright 2001 Randolph Chung <tausq@debian.org> |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
@@ -243,13 +243,11 @@ static int __init led_create_procfs(void) | |||
243 | 243 | ||
244 | proc_pdc_root = proc_mkdir("pdc", 0); | 244 | proc_pdc_root = proc_mkdir("pdc", 0); |
245 | if (!proc_pdc_root) return -1; | 245 | if (!proc_pdc_root) return -1; |
246 | proc_pdc_root->owner = THIS_MODULE; | ||
247 | ent = create_proc_entry("led", S_IFREG|S_IRUGO|S_IWUSR, proc_pdc_root); | 246 | ent = create_proc_entry("led", S_IFREG|S_IRUGO|S_IWUSR, proc_pdc_root); |
248 | if (!ent) return -1; | 247 | if (!ent) return -1; |
249 | ent->data = (void *)LED_NOLCD; /* LED */ | 248 | ent->data = (void *)LED_NOLCD; /* LED */ |
250 | ent->read_proc = led_proc_read; | 249 | ent->read_proc = led_proc_read; |
251 | ent->write_proc = led_proc_write; | 250 | ent->write_proc = led_proc_write; |
252 | ent->owner = THIS_MODULE; | ||
253 | 251 | ||
254 | if (led_type == LED_HASLCD) | 252 | if (led_type == LED_HASLCD) |
255 | { | 253 | { |
@@ -258,7 +256,6 @@ static int __init led_create_procfs(void) | |||
258 | ent->data = (void *)LED_HASLCD; /* LCD */ | 256 | ent->data = (void *)LED_HASLCD; /* LCD */ |
259 | ent->read_proc = led_proc_read; | 257 | ent->read_proc = led_proc_read; |
260 | ent->write_proc = led_proc_write; | 258 | ent->write_proc = led_proc_write; |
261 | ent->owner = THIS_MODULE; | ||
262 | } | 259 | } |
263 | 260 | ||
264 | return 0; | 261 | return 0; |
@@ -463,9 +460,20 @@ static void led_work_func (struct work_struct *unused) | |||
463 | if (likely(led_lanrxtx)) currentleds |= led_get_net_activity(); | 460 | if (likely(led_lanrxtx)) currentleds |= led_get_net_activity(); |
464 | if (likely(led_diskio)) currentleds |= led_get_diskio_activity(); | 461 | if (likely(led_diskio)) currentleds |= led_get_diskio_activity(); |
465 | 462 | ||
466 | /* blink all LEDs twice a second if we got an Oops (HPMC) */ | 463 | /* blink LEDs if we got an Oops (HPMC) */ |
467 | if (unlikely(oops_in_progress)) | 464 | if (unlikely(oops_in_progress)) { |
468 | currentleds = (count_HZ<=(HZ/2)) ? 0 : 0xff; | 465 | if (boot_cpu_data.cpu_type >= pcxl2) { |
466 | /* newer machines don't have loadavg. LEDs, so we | ||
467 | * let all LEDs blink twice per second instead */ | ||
468 | currentleds = (count_HZ <= (HZ/2)) ? 0 : 0xff; | ||
469 | } else { | ||
470 | /* old machines: blink loadavg. LEDs twice per second */ | ||
471 | if (count_HZ <= (HZ/2)) | ||
472 | currentleds &= ~(LED4|LED5|LED6|LED7); | ||
473 | else | ||
474 | currentleds |= (LED4|LED5|LED6|LED7); | ||
475 | } | ||
476 | } | ||
469 | 477 | ||
470 | if (currentleds != lastleds) | 478 | if (currentleds != lastleds) |
471 | { | 479 | { |
@@ -511,7 +519,7 @@ static int led_halt(struct notifier_block *nb, unsigned long event, void *buf) | |||
511 | 519 | ||
512 | /* Cancel the work item and delete the queue */ | 520 | /* Cancel the work item and delete the queue */ |
513 | if (led_wq) { | 521 | if (led_wq) { |
514 | cancel_rearming_delayed_workqueue(led_wq, &led_task); | 522 | cancel_delayed_work_sync(&led_task); |
515 | destroy_workqueue(led_wq); | 523 | destroy_workqueue(led_wq); |
516 | led_wq = NULL; | 524 | led_wq = NULL; |
517 | } | 525 | } |
@@ -630,7 +638,7 @@ int lcd_print( const char *str ) | |||
630 | 638 | ||
631 | /* temporarily disable the led work task */ | 639 | /* temporarily disable the led work task */ |
632 | if (led_wq) | 640 | if (led_wq) |
633 | cancel_rearming_delayed_workqueue(led_wq, &led_task); | 641 | cancel_delayed_work_sync(&led_task); |
634 | 642 | ||
635 | /* copy display string to buffer for procfs */ | 643 | /* copy display string to buffer for procfs */ |
636 | strlcpy(lcd_text, str, sizeof(lcd_text)); | 644 | strlcpy(lcd_text, str, sizeof(lcd_text)); |