linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] leds: Move triggers before drivers in Makefile
@ 2008-08-01 21:48 Sven Wegener
  2008-08-01 23:22 ` Sven Wegener
  0 siblings, 1 reply; 2+ messages in thread
From: Sven Wegener @ 2008-08-01 21:48 UTC (permalink / raw)
  To: Richard Purdie; +Cc: linux-kernel

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@stealer.net>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] leds: Move triggers before drivers in Makefile
  2008-08-01 21:48 [PATCH] leds: Move triggers before drivers in Makefile Sven Wegener
@ 2008-08-01 23:22 ` Sven Wegener
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Wegener @ 2008-08-01 23:22 UTC (permalink / raw)
  To: Richard Purdie; +Cc: linux-kernel

On Fri, 1 Aug 2008, Sven Wegener wrote:

> 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@stealer.net>

Ignore this one, we also attach default triggers to devices while loading 
the triggers.

Sven

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-08-01 23:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-01 21:48 [PATCH] leds: Move triggers before drivers in Makefile Sven Wegener
2008-08-01 23:22 ` Sven Wegener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).