[ar71xx] create firmware image for the Ubiquiti LS-SR71 board
[openwrt.git] / target / linux / s3c24xx / patches-2.6.26 / 1115--led-Misc-fixes-in-the-driver-code.patch
1 From 28b29382f1f9c4f6783054527283a8247b2c5cba Mon Sep 17 00:00:00 2001
2 From: Holger Freyther <zecke@openmoko.org>
3 Date: Fri, 25 Jul 2008 23:06:05 +0100
4 Subject: [PATCH] [led] Misc fixes in the driver code
5 to_bundle returned the wrong data. The platform_device is the
6 parent of the class_device used by the LED device class. Return
7 the correct class.
8
9 num_leds was not set to the correct number of registered LEDs. All
10 loops using num_leds (e.g. module unloading) were not executed at
11 all.
12
13 On removal of the module disable all LEDs.
14
15 Signed-Off-By: Holger Freyther <zecke@openmoko.org>
16 ---
17 drivers/leds/leds-neo1973-gta02.c | 6 +++++-
18 1 files changed, 5 insertions(+), 1 deletions(-)
19
20 diff --git a/drivers/leds/leds-neo1973-gta02.c b/drivers/leds/leds-neo1973-gta02.c
21 index fbb62c4..343550a 100644
22 --- a/drivers/leds/leds-neo1973-gta02.c
23 +++ b/drivers/leds/leds-neo1973-gta02.c
24 @@ -46,7 +46,7 @@ static inline struct gta02_led_priv *to_priv(struct led_classdev *led_cdev)
25
26 static inline struct gta02_led_bundle *to_bundle(struct led_classdev *led_cdev)
27 {
28 - return dev_get_drvdata(led_cdev->dev);
29 + return dev_get_drvdata(led_cdev->dev->parent);
30 }
31
32 static void gta02led_set(struct led_classdev *led_cdev,
33 @@ -174,6 +174,8 @@ static int __init gta02led_probe(struct platform_device *pdev)
34 rc = led_classdev_register(&pdev->dev, &lp->cdev);
35 }
36
37 + bundle->num_leds = i;
38 +
39 return 0;
40 }
41
42 @@ -186,6 +188,8 @@ static int gta02led_remove(struct platform_device *pdev)
43 struct gta02_led_priv *lp = &bundle->led[i];
44 if (lp->has_pwm)
45 s3c2410_pwm_disable(&lp->pwm);
46 + else
47 + gta02led_set(&lp->cdev, 0);
48
49 led_classdev_unregister(&lp->cdev);
50 mutex_destroy(&lp->mutex);
51 --
52 1.5.6.3
53
This page took 0.039808 seconds and 5 git commands to generate.