aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamu Onkalo <samu.p.onkalo@nokia.com>2011-01-12 19:59:17 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-13 11:03:05 -0500
commit278ad4fd0e7517f1d74b8fc1c8347cad34a09b02 (patch)
treefd168660d4938d61a7f04e6e112fcac8a401371a
parent125c7135251de3aea1429968aea9bdfcb6535fc7 (diff)
leds: leds-lp5523: modify the way of setting led device name
Currently all leds channels begins with string lp5523. Patch adds a possibility to provide name via platform data. This makes it possible to have several chips without overlapping sysfs names. Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com> Cc: Arun Murthy <arun.murthy@stericsson.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>
-rw-r--r--drivers/leds/leds-lp5523.c3
-rw-r--r--include/linux/leds-lp5523.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
index 0cc4ead2fd8b..6cb41607519d 100644
--- a/drivers/leds/leds-lp5523.c
+++ b/drivers/leds/leds-lp5523.c
@@ -870,7 +870,8 @@ static int __init lp5523_init_led(struct lp5523_led *led, struct device *dev,
870 return -EINVAL; 870 return -EINVAL;
871 } 871 }
872 872
873 snprintf(name, 32, "lp5523:channel%d", chan); 873 snprintf(name, sizeof(name), "%s:channel%d",
874 pdata->label ?: "lp5523", chan);
874 875
875 led->cdev.name = name; 876 led->cdev.name = name;
876 led->cdev.brightness_set = lp5523_set_brightness; 877 led->cdev.brightness_set = lp5523_set_brightness;
diff --git a/include/linux/leds-lp5523.h b/include/linux/leds-lp5523.h
index 796747637b80..2694289babd0 100644
--- a/include/linux/leds-lp5523.h
+++ b/include/linux/leds-lp5523.h
@@ -42,6 +42,7 @@ struct lp5523_platform_data {
42 int (*setup_resources)(void); 42 int (*setup_resources)(void);
43 void (*release_resources)(void); 43 void (*release_resources)(void);
44 void (*enable)(bool state); 44 void (*enable)(bool state);
45 const char *label;
45}; 46};
46 47
47#endif /* __LINUX_LP5523_H */ 48#endif /* __LINUX_LP5523_H */