login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
December
»
16
Re: [PATCH] leds-lp5521: modify the way of setting led device name
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [author]
[view in full thread]
From: Onkalo Samu
Subject:
Re: [PATCH] leds-lp5521: modify the way of setting led device name
Date: Thursday, December 16, 2010 - 6:07 am
On Wed, 2010-12-15 at 17:25 +0530, ext Arun Murthy wrote:
quoted text
> 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>
Looks ok. I'll make similar patch for lp5523 at some point. Acked-by: Samu Onkalo <samu.p.onkalo@nokia.com>
quoted text
> --- > drivers/leds/leds-lp5521.c | 3 ++- > include/linux/leds-lp5521.h | 1 + > 2 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c > index 33facd0..745ad99 100644 > --- a/drivers/leds/leds-lp5521.c > +++ b/drivers/leds/leds-lp5521.c > @@ -651,7 +651,8 @@ static int __init lp5521_init_led(struct lp5521_led *led, > return -EINVAL; > } > > - snprintf(name, sizeof(name), "%s:channel%d", client->name, chan); > + snprintf(name, sizeof(name), "%s:channel%d", > + pdata->label ?: client->name, chan); > led->cdev.brightness_set = lp5521_set_brightness; > led->cdev.name = name; > res = led_classdev_register(dev, &led->cdev); > diff --git a/include/linux/leds-lp5521.h b/include/linux/leds-lp5521.h > index 38368d7..fd548d2 100644 > --- a/include/linux/leds-lp5521.h > +++ b/include/linux/leds-lp5521.h > @@ -42,6 +42,7 @@ struct lp5521_platform_data { > int (*setup_resources)(void); > void (*release_resources)(void); > void (*enable)(bool state); > + const char *label; > }; > > #endif /* __LINUX_LP5521_H */
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [author]
Messages in current thread:
[PATCH] leds-lp5521: modify the way of setting led device name
, Arun Murthy
, (Wed Dec 15, 4:55 am)
Re: [PATCH] leds-lp5521: modify the way of setting led dev ...
, Onkalo Samu
, (Thu Dec 16, 6:07 am)
RE: [PATCH] leds-lp5521: modify the way of setting led dev ...
, Arun MURTHY
, (Sun Dec 19, 3:57 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Stefan Richter
Re: sata & scsi suggestion for make menuconfig
Rafael J. Wysocki
[Bug #11409] build issue #564 for v2.6.27-rc4 : undefined reference to `NS8390p_in...
Greg Kroah-Hartman
[PATCH 20/36] Driver core: Call device_pm_add() after bus_add_device() in device_a...
Marcin Slusarz
Re: [PATCH] ufs: [bl]e*_add_cpu conversion
Andrew Morton
2.6.23-rc6-mm1
git
:
Junio C Hamano
Re: git-svnimport
Anuj Gakhar
Git Architecture Question
Johannes Schindelin
Re: [PATCH] Fix approxidate("never") to always return 0
A Large Angry SCM
Re: [RFC] origin link for cherry-pick and revert
Gabriel
[PATCH] When a remote is added but not fetched, tell the user.
linux-netdev
:
Gerrit Renker
v2 [PATCH 1/4] dccp: Limit feature negotiation to connection setup phase
Daniel Lezcano
getsockopt(TCP_DEFER_ACCEPT) value change
David Miller
Re: 2.6.27.18: bnx2/tg3: BUG: "scheduling while atomic" trying to ifenslave a seco...
Ingo Molnar
Re: [regression] nf_iterate(), BUG: unable to handle kernel NULL pointer dereference
Gerrit Renker
[PATCH 37/37] dccp: Debugging functions for feature negotiation
git-commits-head
:
Linux Kernel Mailing List
ath9k_htc: Allocate URBs properly
Linux Kernel Mailing List
[ARM] dma: use new dmabounce_sync_for_xxx() for dma_sync_single_xxx()
Linux Kernel Mailing List
MIPS: Cavium: Remove unused watchdog code.
Linux Kernel Mailing List
V4L/DVB (8976): af9015: Add USB ID for AVerMedia A309
Linux Kernel Mailing List
ARM: 5670/1: bcmring: add default configuration for bcmring arch
openbsd-misc
:
Christophe Rioux
Implementation example of snmp
Jason Dixon
Re: any web management gui for pf ?
Nick Holland
Re: booting openbsd on eee without cd-rom
Bryan Irvine
Re: OpenBSD 4.7 Released, May 19 2010
Marco Peereboom
Re: Singularity OS
Colocation donated by:
Syndicate