diff options
author | Arun Murthy <arun.murthy@stericsson.com> | 2011-01-12 19:59:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 11:03:06 -0500 |
commit | 61a83932b8b3f1624d753e06aab2fdf0a119e100 (patch) | |
tree | 1ef51cde13f26aeba3d5896fa9e6dd58c8701d13 /drivers/leds | |
parent | d4e7ad03e84b2301be4f9a39ef2778126699ff0c (diff) |
leds-lp5521: modify the way of setting led device name
Currently the led device name is fetched from the device_type in
I2C_BOARD_INFO which comes from the platform data. This name is in turn
used to create an entry in sysfs.
If there exists two or more lp5521 on a particular platform, the
device_type in I2C_BOARD_INFO has to be the same, else lp5521 driver probe
wont be called and if used so, results in run time warning "cannot create
sysfs with same name" and hence a failure.
The name that is used to create sysfs entry is to be passed by the struct
led_platform_data. Hence adding an element of type const char * and
change in lp5521 driver to use this name in creating the led device if
present else use the name obtained by I2C_BOARD_INFO.
Signed-off-by: Arun Murthy <arun.murthy@stericsson.com>
Acked-by: Samu Onkalo <samu.p.onkalo@nokia.com>
Cc: Ilkka Koskinen <ilkka.koskinen@nokia.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/leds')
-rw-r--r-- | drivers/leds/leds-lp5521.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c index 4d91c08656c5..80a3ae3c00b9 100644 --- a/drivers/leds/leds-lp5521.c +++ b/drivers/leds/leds-lp5521.c | |||
@@ -617,7 +617,8 @@ static int __init lp5521_init_led(struct lp5521_led *led, | |||
617 | return -EINVAL; | 617 | return -EINVAL; |
618 | } | 618 | } |
619 | 619 | ||
620 | snprintf(name, sizeof(name), "%s:channel%d", client->name, chan); | 620 | snprintf(name, sizeof(name), "%s:channel%d", |
621 | pdata->label ?: client->name, chan); | ||
621 | led->cdev.brightness_set = lp5521_set_brightness; | 622 | led->cdev.brightness_set = lp5521_set_brightness; |
622 | led->cdev.name = name; | 623 | led->cdev.name = name; |
623 | res = led_classdev_register(dev, &led->cdev); | 624 | res = led_classdev_register(dev, &led->cdev); |