Search
SailfishOS Open Build Service
>
Projects
>
home:dcthang:branches:nemo:devel:hw:ti:omap3:n900
>
kernel-adaptation-n900
> linux-2.6-38-leds-leds-lp5523-modify-the-way-of-setting-led-devic.patch
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File linux-2.6-38-leds-leds-lp5523-modify-the-way-of-setting-led-devic.patch of Package kernel-adaptation-n900
From 8f333cf8ceec2d2f42a5ca42e4330242ef2770d9 Mon Sep 17 00:00:00 2001 From: Samu Onkalo <samu.p.onkalo@nokia.com> Date: Wed, 12 Jan 2011 16:59:17 -0800 Subject: [PATCH 29/42] 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> --- drivers/leds/leds-lp5523.c | 3 ++- include/linux/leds-lp5523.h | 1 + 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c index 0cc4ead..6cb4160 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, return -EINVAL; } - snprintf(name, 32, "lp5523:channel%d", chan); + snprintf(name, sizeof(name), "%s:channel%d", + pdata->label ?: "lp5523", chan); led->cdev.name = name; led->cdev.brightness_set = lp5523_set_brightness; diff --git a/include/linux/leds-lp5523.h b/include/linux/leds-lp5523.h index 7967476..2694289 100644 --- a/include/linux/leds-lp5523.h +++ b/include/linux/leds-lp5523.h @@ -42,6 +42,7 @@ struct lp5523_platform_data { int (*setup_resources)(void); void (*release_resources)(void); void (*enable)(bool state); + const char *label; }; #endif /* __LINUX_LP5523_H */ -- 1.7.0.4