Re: [PATCH 11/12] LED: Add IDE disk activity LED trigger

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



IDE disk activity fixes: 

Catch failure case of driver_register().
Only trigger on blk_fs end requests.

Signed-off-by: Richard Purdie <[email protected]>

Index: linux-2.6.15/drivers/ide/ide-disk.c
===================================================================
--- linux-2.6.15.orig/drivers/ide/ide-disk.c	2006-02-08 01:09:23.000000000 +0000
+++ linux-2.6.15/drivers/ide/ide-disk.c	2006-02-08 01:08:39.000000000 +0000
@@ -302,7 +302,8 @@
 
 static int ide_end_rw_disk(ide_drive_t *drive, int uptodate, int nr_sectors)
 {
-	led_trigger_event(ide_led_trigger, LED_OFF);
+	if (blk_fs_request(HWGROUP(drive)->rq))
+		led_trigger_event(ide_led_trigger, LED_OFF);
 	return ide_end_request(drive, uptodate, nr_sectors);
 }
 
@@ -1251,8 +1252,10 @@
 
 static int __init idedisk_init(void)
 {
-	led_trigger_register_simple("ide-disk", &ide_led_trigger);
-	return driver_register(&idedisk_driver.gen_driver);
+	int ret = driver_register(&idedisk_driver.gen_driver);
+	if (ret >= 0)
+		led_trigger_register_simple("ide-disk", &ide_led_trigger);
+	return ret;
 }
 
 MODULE_ALIAS("ide:*m-disk*");


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux