Skip to contentSkip to conversation

leds: set LEDS_TRIGGERS as tristate

PATCH In review Bryan Wu 2 participants 5 messages Sep 5, 2011 – Sep 27, 2011 LED

lore
Share & tools
lore

Bryan Wu

author
#0 lore raw

PATCH v2 1/1 leds: set LEDS_TRIGGERS as tristate

LEDS_TRIGGERS is depends on LEDS_CLASSS, which should be tristate. So set it as tristate too and update header files as well.

---
 drivers/leds/Kconfig |    2 +-
 drivers/leds/leds.h  |    2 +-
 include/linux/leds.h |    7 ++++---
 3 files changed, 6 insertions(+), 5 deletions(-)
drivers/leds/Kconfig +1 -1
index 1c35927..0238719 100644
@@ -387,7 +387,7 @@ config LEDS_ASIC3
 	  period from 62ms to 125s. Say Y to enable LEDs on the HP iPAQ hx4700.
 
 config LEDS_TRIGGERS
-	bool "LED Trigger support"
+	tristate "LED Trigger support"
 	depends on LEDS_CLASS
 	help
 	  This option enables trigger support for the leds class.
drivers/leds/leds.h +1 -1
index e77c7f8..53b59b7 100644
@@ -35,7 +35,7 @@ static inline int led_get_brightness(struct led_classdev *led_cdev)
 extern struct rw_semaphore leds_list_lock;
 extern struct list_head leds_list;
 
-#ifdef CONFIG_LEDS_TRIGGERS
+#if defined(CONFIG_LEDS_TRIGGERS) || defined(CONFIG_LEDS_TRIGGERS_MODULE)
 void led_trigger_set_default(struct led_classdev *led_cdev);
 void led_trigger_set(struct led_classdev *led_cdev,
 			struct led_trigger *trigger);
include/linux/leds.h +4 -3
index 5884def..051bc7e 100644
@@ -66,7 +66,7 @@ struct led_classdev {
 	struct timer_list	 blink_timer;
 	int			 blink_brightness;
 
-#ifdef CONFIG_LEDS_TRIGGERS
+#if defined(CONFIG_LEDS_TRIGGERS) || defined(CONFIG_LEDS_TRIGGERS_MODULE)
 	/* Protects the trigger data below */
 	struct rw_semaphore	 trigger_lock;
 
@@ -115,7 +115,7 @@ extern void led_brightness_set(struct led_classdev *led_cdev,
 /*
  * LED Triggers
  */
-#ifdef CONFIG_LEDS_TRIGGERS
+#if defined(CONFIG_LEDS_TRIGGERS) || defined(CONFIG_LEDS_TRIGGERS_MODULE)
 
 #define TRIG_NAME_MAX 50
 
@@ -161,7 +161,8 @@ extern void led_trigger_blink(struct led_trigger *trigger,
 #endif
 
 /* Trigger specific functions */
-#ifdef CONFIG_LEDS_TRIGGER_IDE_DISK
+#if defined(CONFIG_LEDS_TRIGGER_IDE_DISK) || \
+	defined(CONFIG_LEDS_TRIGGER_IDE_DISK_MODULE)
 extern void ledtrig_ide_activity(void);
 #else
 #define ledtrig_ide_activity() do {} while(0)
Signature · 1 line
1.7.4.1
author
#1 lore raw

Richard,

How do you think this patch, I think we need this after we change LEDS_CLASS back to tristate.

Thanks,
-Bryan

Quoted 72 lines · Bryan Wu

LEDS_TRIGGERS is depends on LEDS_CLASSS, which should be tristate. So set it as tristate too and update header files as well.

---
 drivers/leds/Kconfig |    2 +-
 drivers/leds/leds.h  |    2 +-
 include/linux/leds.h |    7 ++++---

 3 files changed, 6 insertions(+), 5 deletions(-)
drivers/leds/Kconfig +0 -0
index 1c35927..0238719 100644
@@ -387,7 +387,7 @@ config LEDS_ASIC3

         period from 62ms to 125s. Say Y to enable LEDs on the HP iPAQ hx4700.

 config LEDS_TRIGGERS
-       bool "LED Trigger support"
+       tristate "LED Trigger support"
       depends on LEDS_CLASS
       help
         This option enables trigger support for the leds class.

drivers/leds/leds.h +1 -1
index e77c7f8..53b59b7 100644
@@ -35,7 +35,7 @@ static inline int led_get_brightness(struct led_classdev *led_cdev)
  extern struct rw_semaphore leds_list_lock;
  extern struct list_head leds_list;
 
-#ifdef CONFIG_LEDS_TRIGGERS
+#if defined(CONFIG_LEDS_TRIGGERS) || defined(CONFIG_LEDS_TRIGGERS_MODULE)
  void led_trigger_set_default(struct led_classdev *led_cdev);
  void led_trigger_set(struct led_classdev *led_cdev,
                        struct led_trigger *trigger);
include/linux/leds.h +4 -4
index 5884def..051bc7e 100644
@@ -66,7 +66,7 @@ struct led_classdev {
        struct timer_list        blink_timer;
        int                      blink_brightness;
 
-#ifdef CONFIG_LEDS_TRIGGERS
+#if defined(CONFIG_LEDS_TRIGGERS) || defined(CONFIG_LEDS_TRIGGERS_MODULE)
        /* Protects the trigger data below */
        struct rw_semaphore      trigger_lock;
 
@@ -115,7 +115,7 @@ extern void led_brightness_set(struct led_classdev *led_cdev,
  /*
  * LED Triggers
  */
-#ifdef CONFIG_LEDS_TRIGGERS
+#if defined(CONFIG_LEDS_TRIGGERS) || defined(CONFIG_LEDS_TRIGGERS_MODULE)
 
  #define TRIG_NAME_MAX 50
 
@@ -161,7 +161,8 @@ extern void led_trigger_blink(struct led_trigger *trigger,
  #endif
 
  /* Trigger specific functions */
-#ifdef CONFIG_LEDS_TRIGGER_IDE_DISK
+#if defined(CONFIG_LEDS_TRIGGER_IDE_DISK) || \
+       defined(CONFIG_LEDS_TRIGGER_IDE_DISK_MODULE)
  extern void ledtrig_ide_activity(void);
  #else
  #define ledtrig_ide_activity() do {} while(0)
--

1.7.4.1

Signature · 5 lines
Bryan Wu <[email protected]>
Kernel Developer    +86.138-1617-6545 Mobile
Ubuntu Kernel Team
Canonical Ltd.      www.canonical.com
Ubuntu - Linux for human beings | www.ubuntu.com
#2 lore raw
In reply to Bryan Wu
Quoted 3 lines · On Tue, 6 Sep 2011 05:56:02 +0800 Bryan Wu <[email protected]> wrote:

LEDS_TRIGGERS is depends on LEDS_CLASSS, which should be tristate. So set it as tristate too and update header files as well.

This patch is causing breakage in today's linux-next. x86 allmodconfig:

drivers/mmc/core/core.c: In function 'mmc_request_done':
drivers/mmc/core/core.c:153: error: 'struct mmc_host' has no member named 'led' drivers/mmc/core/core.c: In function 'mmc_start_request':
drivers/mmc/core/core.c:237: error: 'struct mmc_host' has no member named 'led'

#3 lore raw
In reply to Bryan Wu
Quoted 3 lines · On Tue, 6 Sep 2011 05:56:02 +0800 Bryan Wu <[email protected]> wrote:

LEDS_TRIGGERS is depends on LEDS_CLASSS, which should be tristate. So set it as tristate too and update header files as well.

Another allmodconfig failure:

drivers/built-in.o: In function `led_trigger_blink':
(.text+0x119206): undefined reference to led_blink_set' drivers/built-in.o: In function led_trigger_set':
(.text+0x119389): undefined reference to `led_brightness_set'

I *think* it will be caused by this patch. I'll drop it and see :(

author
#4 lore raw
Quoted 7 lines · Andrew Morton
Quoted 3 lines · On Tue,  6 Sep 2011 05:56:02 +0800 Bryan Wu <[email protected]> wrote:

LEDS_TRIGGERS is depends on LEDS_CLASSS, which should be tristate. So set it as tristate too and update header files as well.

Quoted 9 lines

Another allmodconfig failure:

drivers/built-in.o: In function `led_trigger_blink':
(.text+0x119206): undefined reference to led_blink_set' drivers/built-in.o: In function led_trigger_set':
(.text+0x119389): undefined reference to `led_brightness_set'

I *think* it will be caused by this patch.  I'll drop it and see :(

It requires my second patch. I will fold them together and submit it again.

Thanks a lot,

Signature · 5 lines
Bryan Wu <[email protected]>
Kernel Developer    +86.138-1617-6545 Mobile
Ubuntu Kernel Team
Canonical Ltd.      www.canonical.com
Ubuntu - Linux for human beings | www.ubuntu.com