aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorNémeth Márton <nm127@freemail.hu>2008-03-09 16:59:57 -0400
committerRichard Purdie <rpurdie@rpsys.net>2008-04-24 18:37:42 -0400
commit4d404fd5c51772720e9c72aa3185bd5119bc6e69 (patch)
tree31fc8b3a99ca54a060a61e94a3f8acc05494fcfd /drivers/leds
parent0013b23d66a2768f5babbb0ea9f03ab067a990d8 (diff)
leds: Cleanup various whitespace and code style issues
Break the lines which were more than 80 characters into more lines; replace SPACEs with TABs; correct ident at switch-case; change character encoding from ISO-8859-2 to UTF-8. The order of the functions in led-triggers.c changed in order the similar functions can still be together under titles "Used by LED Class", "LED Trigger Interface" and "Simple LED Tigger Interface" as was grouped before when exported with EXPORT_SYMBOL. Signed-off-by: Márton Németh <nm127@freemail.hu> Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/led-core.c4
-rw-r--r--drivers/leds/led-triggers.c110
-rw-r--r--drivers/leds/leds-clevo-mail.c6
-rw-r--r--drivers/leds/leds-cobalt-qube.c2
-rw-r--r--drivers/leds/leds-cobalt-raq.c6
-rw-r--r--drivers/leds/leds-corgi.c11
-rw-r--r--drivers/leds/leds-h1940.c64
-rw-r--r--drivers/leds/leds-hp6xx.c6
-rw-r--r--drivers/leds/leds-s3c24xx.c4
-rw-r--r--drivers/leds/leds-spitz.c11
-rw-r--r--drivers/leds/leds.h6
-rw-r--r--drivers/leds/ledtrig-ide-disk.c2
-rw-r--r--drivers/leds/ledtrig-timer.c12
13 files changed, 126 insertions, 118 deletions
diff --git a/drivers/leds/led-core.c b/drivers/leds/led-core.c
index 5d1ca10524b6..016d19f5486f 100644
--- a/drivers/leds/led-core.c
+++ b/drivers/leds/led-core.c
@@ -19,7 +19,7 @@
19#include "leds.h" 19#include "leds.h"
20 20
21DECLARE_RWSEM(leds_list_lock); 21DECLARE_RWSEM(leds_list_lock);
22LIST_HEAD(leds_list); 22EXPORT_SYMBOL_GPL(leds_list_lock);
23 23
24LIST_HEAD(leds_list);
24EXPORT_SYMBOL_GPL(leds_list); 25EXPORT_SYMBOL_GPL(leds_list);
25EXPORT_SYMBOL_GPL(leds_list_lock);
diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c
index 21dd96909444..0f242b3f09b6 100644
--- a/drivers/leds/led-triggers.c
+++ b/drivers/leds/led-triggers.c
@@ -29,6 +29,8 @@
29static DECLARE_RWSEM(triggers_list_lock); 29static DECLARE_RWSEM(triggers_list_lock);
30static LIST_HEAD(trigger_list); 30static LIST_HEAD(trigger_list);
31 31
32 /* Used by LED Class */
33
32ssize_t led_trigger_store(struct device *dev, struct device_attribute *attr, 34ssize_t led_trigger_store(struct device *dev, struct device_attribute *attr,
33 const char *buf, size_t count) 35 const char *buf, size_t count)
34{ 36{
@@ -64,7 +66,7 @@ ssize_t led_trigger_store(struct device *dev, struct device_attribute *attr,
64 66
65 return -EINVAL; 67 return -EINVAL;
66} 68}
67 69EXPORT_SYMBOL_GPL(led_trigger_store);
68 70
69ssize_t led_trigger_show(struct device *dev, struct device_attribute *attr, 71ssize_t led_trigger_show(struct device *dev, struct device_attribute *attr,
70 char *buf) 72 char *buf)
@@ -94,24 +96,7 @@ ssize_t led_trigger_show(struct device *dev, struct device_attribute *attr,
94 len += sprintf(len+buf, "\n"); 96 len += sprintf(len+buf, "\n");
95 return len; 97 return len;
96} 98}
97 99EXPORT_SYMBOL_GPL(led_trigger_show);
98void led_trigger_event(struct led_trigger *trigger,
99 enum led_brightness brightness)
100{
101 struct list_head *entry;
102
103 if (!trigger)
104 return;
105
106 read_lock(&trigger->leddev_list_lock);
107 list_for_each(entry, &trigger->led_cdevs) {
108 struct led_classdev *led_cdev;
109
110 led_cdev = list_entry(entry, struct led_classdev, trig_list);
111 led_set_brightness(led_cdev, brightness);
112 }
113 read_unlock(&trigger->leddev_list_lock);
114}
115 100
116/* Caller must ensure led_cdev->trigger_lock held */ 101/* Caller must ensure led_cdev->trigger_lock held */
117void led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trigger) 102void led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trigger)
@@ -122,7 +107,8 @@ void led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trigger)
122 if (led_cdev->trigger) { 107 if (led_cdev->trigger) {
123 write_lock_irqsave(&led_cdev->trigger->leddev_list_lock, flags); 108 write_lock_irqsave(&led_cdev->trigger->leddev_list_lock, flags);
124 list_del(&led_cdev->trig_list); 109 list_del(&led_cdev->trig_list);
125 write_unlock_irqrestore(&led_cdev->trigger->leddev_list_lock, flags); 110 write_unlock_irqrestore(&led_cdev->trigger->leddev_list_lock,
111 flags);
126 if (led_cdev->trigger->deactivate) 112 if (led_cdev->trigger->deactivate)
127 led_cdev->trigger->deactivate(led_cdev); 113 led_cdev->trigger->deactivate(led_cdev);
128 led_set_brightness(led_cdev, LED_OFF); 114 led_set_brightness(led_cdev, LED_OFF);
@@ -136,6 +122,7 @@ void led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trigger)
136 } 122 }
137 led_cdev->trigger = trigger; 123 led_cdev->trigger = trigger;
138} 124}
125EXPORT_SYMBOL_GPL(led_trigger_set);
139 126
140void led_trigger_remove(struct led_classdev *led_cdev) 127void led_trigger_remove(struct led_classdev *led_cdev)
141{ 128{
@@ -143,6 +130,7 @@ void led_trigger_remove(struct led_classdev *led_cdev)
143 led_trigger_set(led_cdev, NULL); 130 led_trigger_set(led_cdev, NULL);
144 up_write(&led_cdev->trigger_lock); 131 up_write(&led_cdev->trigger_lock);
145} 132}
133EXPORT_SYMBOL_GPL(led_trigger_remove);
146 134
147void led_trigger_set_default(struct led_classdev *led_cdev) 135void led_trigger_set_default(struct led_classdev *led_cdev)
148{ 136{
@@ -160,6 +148,9 @@ void led_trigger_set_default(struct led_classdev *led_cdev)
160 up_write(&led_cdev->trigger_lock); 148 up_write(&led_cdev->trigger_lock);
161 up_read(&triggers_list_lock); 149 up_read(&triggers_list_lock);
162} 150}
151EXPORT_SYMBOL_GPL(led_trigger_set_default);
152
153/* LED Trigger Interface */
163 154
164int led_trigger_register(struct led_trigger *trigger) 155int led_trigger_register(struct led_trigger *trigger)
165{ 156{
@@ -186,26 +177,7 @@ int led_trigger_register(struct led_trigger *trigger)
186 177
187 return 0; 178 return 0;
188} 179}
189 180EXPORT_SYMBOL_GPL(led_trigger_register);
190void led_trigger_register_simple(const char *name, struct led_trigger **tp)
191{
192 struct led_trigger *trigger;
193 int err;
194
195 trigger = kzalloc(sizeof(struct led_trigger), GFP_KERNEL);
196
197 if (trigger) {
198 trigger->name = name;
199 err = led_trigger_register(trigger);
200 if (err < 0)
201 printk(KERN_WARNING "LED trigger %s failed to register"
202 " (%d)\n", name, err);
203 } else
204 printk(KERN_WARNING "LED trigger %s failed to register"
205 " (no memory)\n", name);
206
207 *tp = trigger;
208}
209 181
210void led_trigger_unregister(struct led_trigger *trigger) 182void led_trigger_unregister(struct led_trigger *trigger)
211{ 183{
@@ -226,29 +198,57 @@ void led_trigger_unregister(struct led_trigger *trigger)
226 } 198 }
227 up_read(&leds_list_lock); 199 up_read(&leds_list_lock);
228} 200}
201EXPORT_SYMBOL_GPL(led_trigger_unregister);
229 202
230void led_trigger_unregister_simple(struct led_trigger *trigger) 203/* Simple LED Tigger Interface */
204
205void led_trigger_event(struct led_trigger *trigger,
206 enum led_brightness brightness)
231{ 207{
232 if (trigger) 208 struct list_head *entry;
233 led_trigger_unregister(trigger); 209
234 kfree(trigger); 210 if (!trigger)
211 return;
212
213 read_lock(&trigger->leddev_list_lock);
214 list_for_each(entry, &trigger->led_cdevs) {
215 struct led_classdev *led_cdev;
216
217 led_cdev = list_entry(entry, struct led_classdev, trig_list);
218 led_set_brightness(led_cdev, brightness);
219 }
220 read_unlock(&trigger->leddev_list_lock);
235} 221}
222EXPORT_SYMBOL_GPL(led_trigger_event);
236 223
237/* Used by LED Class */ 224void led_trigger_register_simple(const char *name, struct led_trigger **tp)
238EXPORT_SYMBOL_GPL(led_trigger_set); 225{
239EXPORT_SYMBOL_GPL(led_trigger_remove); 226 struct led_trigger *trigger;
240EXPORT_SYMBOL_GPL(led_trigger_set_default); 227 int err;
241EXPORT_SYMBOL_GPL(led_trigger_show);
242EXPORT_SYMBOL_GPL(led_trigger_store);
243 228
244/* LED Trigger Interface */ 229 trigger = kzalloc(sizeof(struct led_trigger), GFP_KERNEL);
245EXPORT_SYMBOL_GPL(led_trigger_register);
246EXPORT_SYMBOL_GPL(led_trigger_unregister);
247 230
248/* Simple LED Tigger Interface */ 231 if (trigger) {
232 trigger->name = name;
233 err = led_trigger_register(trigger);
234 if (err < 0)
235 printk(KERN_WARNING "LED trigger %s failed to register"
236 " (%d)\n", name, err);
237 } else
238 printk(KERN_WARNING "LED trigger %s failed to register"
239 " (no memory)\n", name);
240
241 *tp = trigger;
242}
249EXPORT_SYMBOL_GPL(led_trigger_register_simple); 243EXPORT_SYMBOL_GPL(led_trigger_register_simple);
244
245void led_trigger_unregister_simple(struct led_trigger *trigger)
246{
247 if (trigger)
248 led_trigger_unregister(trigger);
249 kfree(trigger);
250}
250EXPORT_SYMBOL_GPL(led_trigger_unregister_simple); 251EXPORT_SYMBOL_GPL(led_trigger_unregister_simple);
251EXPORT_SYMBOL_GPL(led_trigger_event);
252 252
253MODULE_AUTHOR("Richard Purdie"); 253MODULE_AUTHOR("Richard Purdie");
254MODULE_LICENSE("GPL"); 254MODULE_LICENSE("GPL");
diff --git a/drivers/leds/leds-clevo-mail.c b/drivers/leds/leds-clevo-mail.c
index d78fe6cd5a52..eb3415e88f43 100644
--- a/drivers/leds/leds-clevo-mail.c
+++ b/drivers/leds/leds-clevo-mail.c
@@ -14,7 +14,7 @@
14#define CLEVO_MAIL_LED_BLINK_1HZ 0x008A 14#define CLEVO_MAIL_LED_BLINK_1HZ 0x008A
15#define CLEVO_MAIL_LED_BLINK_0_5HZ 0x0083 15#define CLEVO_MAIL_LED_BLINK_0_5HZ 0x0083
16 16
17MODULE_AUTHOR("Márton Németh <nm127@freemail.hu>"); 17MODULE_AUTHOR("Márton Németh <nm127@freemail.hu>");
18MODULE_DESCRIPTION("Clevo mail LED driver"); 18MODULE_DESCRIPTION("Clevo mail LED driver");
19MODULE_LICENSE("GPL"); 19MODULE_LICENSE("GPL");
20 20
@@ -103,8 +103,8 @@ static void clevo_mail_led_set(struct led_classdev *led_cdev,
103} 103}
104 104
105static int clevo_mail_led_blink(struct led_classdev *led_cdev, 105static int clevo_mail_led_blink(struct led_classdev *led_cdev,
106 unsigned long* delay_on, 106 unsigned long *delay_on,
107 unsigned long* delay_off) 107 unsigned long *delay_off)
108{ 108{
109 int status = -EINVAL; 109 int status = -EINVAL;
110 110
diff --git a/drivers/leds/leds-cobalt-qube.c b/drivers/leds/leds-cobalt-qube.c
index 096881a11b1a..059aa2924b1c 100644
--- a/drivers/leds/leds-cobalt-qube.c
+++ b/drivers/leds/leds-cobalt-qube.c
@@ -18,7 +18,7 @@ static void __iomem *led_port;
18static u8 led_value; 18static u8 led_value;
19 19
20static void qube_front_led_set(struct led_classdev *led_cdev, 20static void qube_front_led_set(struct led_classdev *led_cdev,
21 enum led_brightness brightness) 21 enum led_brightness brightness)
22{ 22{
23 if (brightness) 23 if (brightness)
24 led_value = LED_FRONT_LEFT | LED_FRONT_RIGHT; 24 led_value = LED_FRONT_LEFT | LED_FRONT_RIGHT;
diff --git a/drivers/leds/leds-cobalt-raq.c b/drivers/leds/leds-cobalt-raq.c
index 6ebfff341e6c..ff0e8c3fbf9b 100644
--- a/drivers/leds/leds-cobalt-raq.c
+++ b/drivers/leds/leds-cobalt-raq.c
@@ -15,7 +15,7 @@
15 * 15 *
16 * You should have received a copy of the GNU General Public License 16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software 17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */ 19 */
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/io.h> 21#include <linux/io.h>
@@ -33,7 +33,7 @@ static u8 led_value;
33static DEFINE_SPINLOCK(led_value_lock); 33static DEFINE_SPINLOCK(led_value_lock);
34 34
35static void raq_web_led_set(struct led_classdev *led_cdev, 35static void raq_web_led_set(struct led_classdev *led_cdev,
36 enum led_brightness brightness) 36 enum led_brightness brightness)
37{ 37{
38 unsigned long flags; 38 unsigned long flags;
39 39
@@ -54,7 +54,7 @@ static struct led_classdev raq_web_led = {
54}; 54};
55 55
56static void raq_power_off_led_set(struct led_classdev *led_cdev, 56static void raq_power_off_led_set(struct led_classdev *led_cdev,
57 enum led_brightness brightness) 57 enum led_brightness brightness)
58{ 58{
59 unsigned long flags; 59 unsigned long flags;
60 60
diff --git a/drivers/leds/leds-corgi.c b/drivers/leds/leds-corgi.c
index 29e931f89f9c..a709704b9f93 100644
--- a/drivers/leds/leds-corgi.c
+++ b/drivers/leds/leds-corgi.c
@@ -21,7 +21,8 @@
21#include <asm/arch/pxa-regs.h> 21#include <asm/arch/pxa-regs.h>
22#include <asm/hardware/scoop.h> 22#include <asm/hardware/scoop.h>
23 23
24static void corgiled_amber_set(struct led_classdev *led_cdev, enum led_brightness value) 24static void corgiled_amber_set(struct led_classdev *led_cdev,
25 enum led_brightness value)
25{ 26{
26 if (value) 27 if (value)
27 GPSR0 = GPIO_bit(CORGI_GPIO_LED_ORANGE); 28 GPSR0 = GPIO_bit(CORGI_GPIO_LED_ORANGE);
@@ -29,7 +30,8 @@ static void corgiled_amber_set(struct led_classdev *led_cdev, enum led_brightnes
29 GPCR0 = GPIO_bit(CORGI_GPIO_LED_ORANGE); 30 GPCR0 = GPIO_bit(CORGI_GPIO_LED_ORANGE);
30} 31}
31 32
32static void corgiled_green_set(struct led_classdev *led_cdev, enum led_brightness value) 33static void corgiled_green_set(struct led_classdev *led_cdev,
34 enum led_brightness value)
33{ 35{
34 if (value) 36 if (value)
35 set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_LED_GREEN); 37 set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_LED_GREEN);
@@ -53,7 +55,8 @@ static struct led_classdev corgi_green_led = {
53static int corgiled_suspend(struct platform_device *dev, pm_message_t state) 55static int corgiled_suspend(struct platform_device *dev, pm_message_t state)
54{ 56{
55#ifdef CONFIG_LEDS_TRIGGERS 57#ifdef CONFIG_LEDS_TRIGGERS
56 if (corgi_amber_led.trigger && strcmp(corgi_amber_led.trigger->name, "sharpsl-charge")) 58 if (corgi_amber_led.trigger &&
59 strcmp(corgi_amber_led.trigger->name, "sharpsl-charge"))
57#endif 60#endif
58 led_classdev_suspend(&corgi_amber_led); 61 led_classdev_suspend(&corgi_amber_led);
59 led_classdev_suspend(&corgi_green_led); 62 led_classdev_suspend(&corgi_green_led);
@@ -110,7 +113,7 @@ static int __init corgiled_init(void)
110 113
111static void __exit corgiled_exit(void) 114static void __exit corgiled_exit(void)
112{ 115{
113 platform_driver_unregister(&corgiled_driver); 116 platform_driver_unregister(&corgiled_driver);
114} 117}
115 118
116module_init(corgiled_init); 119module_init(corgiled_init);
diff --git a/drivers/leds/leds-h1940.c b/drivers/leds/leds-h1940.c
index 6e51c9b61027..bcec42230389 100644
--- a/drivers/leds/leds-h1940.c
+++ b/drivers/leds/leds-h1940.c
@@ -26,20 +26,20 @@
26void h1940_greenled_set(struct led_classdev *led_dev, enum led_brightness value) 26void h1940_greenled_set(struct led_classdev *led_dev, enum led_brightness value)
27{ 27{
28 switch (value) { 28 switch (value) {
29 case LED_HALF: 29 case LED_HALF:
30 h1940_latch_control(0,H1940_LATCH_LED_FLASH); 30 h1940_latch_control(0, H1940_LATCH_LED_FLASH);
31 s3c2410_gpio_setpin(S3C2410_GPA7,1); 31 s3c2410_gpio_setpin(S3C2410_GPA7, 1);
32 break; 32 break;
33 case LED_FULL: 33 case LED_FULL:
34 h1940_latch_control(0,H1940_LATCH_LED_GREEN); 34 h1940_latch_control(0, H1940_LATCH_LED_GREEN);
35 s3c2410_gpio_setpin(S3C2410_GPA7,1); 35 s3c2410_gpio_setpin(S3C2410_GPA7, 1);
36 break; 36 break;
37 default: 37 default:
38 case LED_OFF: 38 case LED_OFF:
39 h1940_latch_control(H1940_LATCH_LED_FLASH,0); 39 h1940_latch_control(H1940_LATCH_LED_FLASH, 0);
40 h1940_latch_control(H1940_LATCH_LED_GREEN,0); 40 h1940_latch_control(H1940_LATCH_LED_GREEN, 0);
41 s3c2410_gpio_setpin(S3C2410_GPA7,0); 41 s3c2410_gpio_setpin(S3C2410_GPA7, 0);
42 break; 42 break;
43 } 43 }
44} 44}
45 45
@@ -55,20 +55,20 @@ static struct led_classdev h1940_greenled = {
55void h1940_redled_set(struct led_classdev *led_dev, enum led_brightness value) 55void h1940_redled_set(struct led_classdev *led_dev, enum led_brightness value)
56{ 56{
57 switch (value) { 57 switch (value) {
58 case LED_HALF: 58 case LED_HALF:
59 h1940_latch_control(0,H1940_LATCH_LED_FLASH); 59 h1940_latch_control(0, H1940_LATCH_LED_FLASH);
60 s3c2410_gpio_setpin(S3C2410_GPA1,1); 60 s3c2410_gpio_setpin(S3C2410_GPA1, 1);
61 break; 61 break;
62 case LED_FULL: 62 case LED_FULL:
63 h1940_latch_control(0,H1940_LATCH_LED_RED); 63 h1940_latch_control(0, H1940_LATCH_LED_RED);
64 s3c2410_gpio_setpin(S3C2410_GPA1,1); 64 s3c2410_gpio_setpin(S3C2410_GPA1, 1);
65 break; 65 break;
66 default: 66 default:
67 case LED_OFF: 67 case LED_OFF:
68 h1940_latch_control(H1940_LATCH_LED_FLASH,0); 68 h1940_latch_control(H1940_LATCH_LED_FLASH, 0);
69 h1940_latch_control(H1940_LATCH_LED_RED,0); 69 h1940_latch_control(H1940_LATCH_LED_RED, 0);
70 s3c2410_gpio_setpin(S3C2410_GPA1,0); 70 s3c2410_gpio_setpin(S3C2410_GPA1, 0);
71 break; 71 break;
72 } 72 }
73} 73}
74 74
@@ -86,11 +86,11 @@ void h1940_blueled_set(struct led_classdev *led_dev, enum led_brightness value)
86{ 86{
87 if (value) { 87 if (value) {
88 /* flashing Blue */ 88 /* flashing Blue */
89 h1940_latch_control(0,H1940_LATCH_LED_FLASH); 89 h1940_latch_control(0, H1940_LATCH_LED_FLASH);
90 s3c2410_gpio_setpin(S3C2410_GPA3,1); 90 s3c2410_gpio_setpin(S3C2410_GPA3, 1);
91 } else { 91 } else {
92 h1940_latch_control(H1940_LATCH_LED_FLASH,0); 92 h1940_latch_control(H1940_LATCH_LED_FLASH, 0);
93 s3c2410_gpio_setpin(S3C2410_GPA3,0); 93 s3c2410_gpio_setpin(S3C2410_GPA3, 0);
94 } 94 }
95 95
96} 96}
diff --git a/drivers/leds/leds-hp6xx.c b/drivers/leds/leds-hp6xx.c
index 870f5a3789e8..844d5979c904 100644
--- a/drivers/leds/leds-hp6xx.c
+++ b/drivers/leds/leds-hp6xx.c
@@ -17,7 +17,8 @@
17#include <asm/hd64461.h> 17#include <asm/hd64461.h>
18#include <asm/hp6xx.h> 18#include <asm/hp6xx.h>
19 19
20static void hp6xxled_green_set(struct led_classdev *led_cdev, enum led_brightness value) 20static void hp6xxled_green_set(struct led_classdev *led_cdev,
21 enum led_brightness value)
21{ 22{
22 u8 v8; 23 u8 v8;
23 24
@@ -28,7 +29,8 @@ static void hp6xxled_green_set(struct led_classdev *led_cdev, enum led_brightnes
28 outb(v8 | PKDR_LED_GREEN, PKDR); 29 outb(v8 | PKDR_LED_GREEN, PKDR);
29} 30}
30 31
31static void hp6xxled_red_set(struct led_classdev *led_cdev, enum led_brightness value) 32static void hp6xxled_red_set(struct led_classdev *led_cdev,
33 enum led_brightness value)
32{ 34{
33 u16 v16; 35 u16 v16;
34 36
diff --git a/drivers/leds/leds-s3c24xx.c b/drivers/leds/leds-s3c24xx.c
index 0d10e119d8f5..d4f5021dccbf 100644
--- a/drivers/leds/leds-s3c24xx.c
+++ b/drivers/leds/leds-s3c24xx.c
@@ -51,7 +51,7 @@ static void s3c24xx_led_set(struct led_classdev *led_cdev,
51 51
52 if (pd->flags & S3C24XX_LEDF_TRISTATE) 52 if (pd->flags & S3C24XX_LEDF_TRISTATE)
53 s3c2410_gpio_cfgpin(pd->gpio, 53 s3c2410_gpio_cfgpin(pd->gpio,
54 value ? S3C2410_GPIO_OUTPUT : S3C2410_GPIO_INPUT); 54 value ? S3C2410_GPIO_OUTPUT : S3C2410_GPIO_INPUT);
55 55
56} 56}
57 57
@@ -151,7 +151,7 @@ static int __init s3c24xx_led_init(void)
151 151
152static void __exit s3c24xx_led_exit(void) 152static void __exit s3c24xx_led_exit(void)
153{ 153{
154 platform_driver_unregister(&s3c24xx_led_driver); 154 platform_driver_unregister(&s3c24xx_led_driver);
155} 155}
156 156
157module_init(s3c24xx_led_init); 157module_init(s3c24xx_led_init);
diff --git a/drivers/leds/leds-spitz.c b/drivers/leds/leds-spitz.c
index 87007cc362c1..e75e8543bc5a 100644
--- a/drivers/leds/leds-spitz.c
+++ b/drivers/leds/leds-spitz.c
@@ -21,7 +21,8 @@
21#include <asm/arch/pxa-regs.h> 21#include <asm/arch/pxa-regs.h>
22#include <asm/arch/spitz.h> 22#include <asm/arch/spitz.h>
23 23
24static void spitzled_amber_set(struct led_classdev *led_cdev, enum led_brightness value) 24static void spitzled_amber_set(struct led_classdev *led_cdev,
25 enum led_brightness value)
25{ 26{
26 if (value) 27 if (value)
27 set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_LED_ORANGE); 28 set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_LED_ORANGE);
@@ -29,7 +30,8 @@ static void spitzled_amber_set(struct led_classdev *led_cdev, enum led_brightnes
29 reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_LED_ORANGE); 30 reset_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_LED_ORANGE);
30} 31}
31 32
32static void spitzled_green_set(struct led_classdev *led_cdev, enum led_brightness value) 33static void spitzled_green_set(struct led_classdev *led_cdev,
34 enum led_brightness value)
33{ 35{
34 if (value) 36 if (value)
35 set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_LED_GREEN); 37 set_scoop_gpio(&spitzscoop_device.dev, SPITZ_SCP_LED_GREEN);
@@ -53,7 +55,8 @@ static struct led_classdev spitz_green_led = {
53static int spitzled_suspend(struct platform_device *dev, pm_message_t state) 55static int spitzled_suspend(struct platform_device *dev, pm_message_t state)
54{ 56{
55#ifdef CONFIG_LEDS_TRIGGERS 57#ifdef CONFIG_LEDS_TRIGGERS
56 if (spitz_amber_led.trigger && strcmp(spitz_amber_led.trigger->name, "sharpsl-charge")) 58 if (spitz_amber_led.trigger &&
59 strcmp(spitz_amber_led.trigger->name, "sharpsl-charge"))
57#endif 60#endif
58 led_classdev_suspend(&spitz_amber_led); 61 led_classdev_suspend(&spitz_amber_led);
59 led_classdev_suspend(&spitz_green_led); 62 led_classdev_suspend(&spitz_green_led);
@@ -116,7 +119,7 @@ static int __init spitzled_init(void)
116 119
117static void __exit spitzled_exit(void) 120static void __exit spitzled_exit(void)
118{ 121{
119 platform_driver_unregister(&spitzled_driver); 122 platform_driver_unregister(&spitzled_driver);
120} 123}
121 124
122module_init(spitzled_init); 125module_init(spitzled_init);
diff --git a/drivers/leds/leds.h b/drivers/leds/leds.h
index 0214799639f7..5edbf52c4fa7 100644
--- a/drivers/leds/leds.h
+++ b/drivers/leds/leds.h
@@ -41,9 +41,9 @@ void led_trigger_set(struct led_classdev *led_cdev,
41 struct led_trigger *trigger); 41 struct led_trigger *trigger);
42void led_trigger_remove(struct led_classdev *led_cdev); 42void led_trigger_remove(struct led_classdev *led_cdev);
43#else 43#else
44#define led_trigger_set_default(x) do {} while(0) 44#define led_trigger_set_default(x) do {} while (0)
45#define led_trigger_set(x, y) do {} while(0) 45#define led_trigger_set(x, y) do {} while (0)
46#define led_trigger_remove(x) do {} while(0) 46#define led_trigger_remove(x) do {} while (0)
47#endif 47#endif
48 48
49ssize_t led_trigger_store(struct device *dev, struct device_attribute *attr, 49ssize_t led_trigger_store(struct device *dev, struct device_attribute *attr,
diff --git a/drivers/leds/ledtrig-ide-disk.c b/drivers/leds/ledtrig-ide-disk.c
index 54b155c7026f..883a577b1b97 100644
--- a/drivers/leds/ledtrig-ide-disk.c
+++ b/drivers/leds/ledtrig-ide-disk.c
@@ -38,7 +38,7 @@ static void ledtrig_ide_timerfunc(unsigned long data)
38 if (ide_lastactivity != ide_activity) { 38 if (ide_lastactivity != ide_activity) {
39 ide_lastactivity = ide_activity; 39 ide_lastactivity = ide_activity;
40 led_trigger_event(ledtrig_ide, LED_FULL); 40 led_trigger_event(ledtrig_ide, LED_FULL);
41 mod_timer(&ledtrig_ide_timer, jiffies + msecs_to_jiffies(10)); 41 mod_timer(&ledtrig_ide_timer, jiffies + msecs_to_jiffies(10));
42 } else { 42 } else {
43 led_trigger_event(ledtrig_ide, LED_OFF); 43 led_trigger_event(ledtrig_ide, LED_OFF);
44 } 44 }
diff --git a/drivers/leds/ledtrig-timer.c b/drivers/leds/ledtrig-timer.c
index 706297765d93..5c99f4f0c692 100644
--- a/drivers/leds/ledtrig-timer.c
+++ b/drivers/leds/ledtrig-timer.c
@@ -64,7 +64,7 @@ static void led_timer_function(unsigned long data)
64 mod_timer(&timer_data->timer, jiffies + msecs_to_jiffies(delay)); 64 mod_timer(&timer_data->timer, jiffies + msecs_to_jiffies(delay));
65} 65}
66 66
67static ssize_t led_delay_on_show(struct device *dev, 67static ssize_t led_delay_on_show(struct device *dev,
68 struct device_attribute *attr, char *buf) 68 struct device_attribute *attr, char *buf)
69{ 69{
70 struct led_classdev *led_cdev = dev_get_drvdata(dev); 70 struct led_classdev *led_cdev = dev_get_drvdata(dev);
@@ -75,7 +75,7 @@ static ssize_t led_delay_on_show(struct device *dev,
75 return strlen(buf) + 1; 75 return strlen(buf) + 1;
76} 76}
77 77
78static ssize_t led_delay_on_store(struct device *dev, 78static ssize_t led_delay_on_store(struct device *dev,
79 struct device_attribute *attr, const char *buf, size_t size) 79 struct device_attribute *attr, const char *buf, size_t size)
80{ 80{
81 struct led_classdev *led_cdev = dev_get_drvdata(dev); 81 struct led_classdev *led_cdev = dev_get_drvdata(dev);
@@ -99,7 +99,7 @@ static ssize_t led_delay_on_store(struct device *dev,
99 /* try to activate hardware acceleration, if any */ 99 /* try to activate hardware acceleration, if any */
100 if (!led_cdev->blink_set || 100 if (!led_cdev->blink_set ||
101 led_cdev->blink_set(led_cdev, 101 led_cdev->blink_set(led_cdev,
102 &timer_data->delay_on, &timer_data->delay_off)) { 102 &timer_data->delay_on, &timer_data->delay_off)) {
103 /* no hardware acceleration, blink via timer */ 103 /* no hardware acceleration, blink via timer */
104 mod_timer(&timer_data->timer, jiffies + 1); 104 mod_timer(&timer_data->timer, jiffies + 1);
105 } 105 }
@@ -110,7 +110,7 @@ static ssize_t led_delay_on_store(struct device *dev,
110 return ret; 110 return ret;
111} 111}
112 112
113static ssize_t led_delay_off_show(struct device *dev, 113static ssize_t led_delay_off_show(struct device *dev,
114 struct device_attribute *attr, char *buf) 114 struct device_attribute *attr, char *buf)
115{ 115{
116 struct led_classdev *led_cdev = dev_get_drvdata(dev); 116 struct led_classdev *led_cdev = dev_get_drvdata(dev);
@@ -121,7 +121,7 @@ static ssize_t led_delay_off_show(struct device *dev,
121 return strlen(buf) + 1; 121 return strlen(buf) + 1;
122} 122}
123 123
124static ssize_t led_delay_off_store(struct device *dev, 124static ssize_t led_delay_off_store(struct device *dev,
125 struct device_attribute *attr, const char *buf, size_t size) 125 struct device_attribute *attr, const char *buf, size_t size)
126{ 126{
127 struct led_classdev *led_cdev = dev_get_drvdata(dev); 127 struct led_classdev *led_cdev = dev_get_drvdata(dev);
@@ -145,7 +145,7 @@ static ssize_t led_delay_off_store(struct device *dev,
145 /* try to activate hardware acceleration, if any */ 145 /* try to activate hardware acceleration, if any */
146 if (!led_cdev->blink_set || 146 if (!led_cdev->blink_set ||
147 led_cdev->blink_set(led_cdev, 147 led_cdev->blink_set(led_cdev,
148 &timer_data->delay_on, &timer_data->delay_off)) { 148 &timer_data->delay_on, &timer_data->delay_off)) {
149 /* no hardware acceleration, blink via timer */ 149 /* no hardware acceleration, blink via timer */
150 mod_timer(&timer_data->timer, jiffies + 1); 150 mod_timer(&timer_data->timer, jiffies + 1);
151 } 151 }