[PATCH] leds: Move triggers before drivers in Makefile

From: Sven Wegener
Date: Fri Aug 01 2008 - 17:48:38 EST


When both triggers and drivers are built-in, we should first register the
triggers and then the drivers, to make default triggers work during device
registration. We do this by moving the triggers before the drivers in the
Makefile as init order is determined by linking order. Sadly this simple
solution doesn't cover devices registered elsewhere in the kernel. But often
these drivers provide their own triggers and should themselves take care of
registering triggers before devices.

Signed-off-by: Sven Wegener <sven.wegener@xxxxxxxxxxx>
---
drivers/leds/Makefile | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)

Patch is based on your current (024e8ac) leds git tree head.

diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index ff7982b..fa0f257 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -4,6 +4,13 @@ obj-$(CONFIG_NEW_LEDS) += led-core.o
obj-$(CONFIG_LEDS_CLASS) += led-class.o
obj-$(CONFIG_LEDS_TRIGGERS) += led-triggers.o

+# LED Triggers
+# Handle triggers before drivers, to make default triggers work, when built-in.
+obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o
+obj-$(CONFIG_LEDS_TRIGGER_IDE_DISK) += ledtrig-ide-disk.o
+obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT) += ledtrig-heartbeat.o
+obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON) += ledtrig-default-on.o
+
# LED Platform Drivers
obj-$(CONFIG_LEDS_ATMEL_PWM) += leds-atmel-pwm.o
obj-$(CONFIG_LEDS_CORGI) += leds-corgi.o
@@ -23,9 +30,3 @@ obj-$(CONFIG_LEDS_CLEVO_MAIL) += leds-clevo-mail.o
obj-$(CONFIG_LEDS_HP6XX) += leds-hp6xx.o
obj-$(CONFIG_LEDS_FSG) += leds-fsg.o
obj-$(CONFIG_LEDS_PCA955X) += leds-pca955x.o
-
-# LED Triggers
-obj-$(CONFIG_LEDS_TRIGGER_TIMER) += ledtrig-timer.o
-obj-$(CONFIG_LEDS_TRIGGER_IDE_DISK) += ledtrig-ide-disk.o
-obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT) += ledtrig-heartbeat.o
-obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON) += ledtrig-default-on.o
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/