linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: arun.murthy@stericsson.com (Arun Murthy)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv2 3/7] leds: pwm: add a new element 'name' to platform data
Date: Tue, 5 Oct 2010 17:29:58 +0530	[thread overview]
Message-ID: <1286280002-1636-4-git-send-email-arun.murthy@stericsson.com> (raw)
In-Reply-To: <1286280002-1636-1-git-send-email-arun.murthy@stericsson.com>

A new element 'name' is added to pwm led platform data structure.
This is required to identify the pwm device.

Signed-off-by: Arun Murthy <arun.murthy@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@stericsson.com>
---
 drivers/leds/leds-pwm.c  |    4 +++-
 include/linux/leds_pwm.h |    3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
index da3fa8d..8da2be6 100644
--- a/drivers/leds/leds-pwm.c
+++ b/drivers/leds/leds-pwm.c
@@ -66,8 +66,10 @@ static int led_pwm_probe(struct platform_device *pdev)
 		cur_led = &pdata->leds[i];
 		led_dat = &leds_data[i];
 
+		if (!pdata->name)
+			pdata->name = cur_led->name;
 		led_dat->pwm = pwm_request(cur_led->pwm_id,
-				cur_led->name);
+				pdata->name);
 		if (IS_ERR(led_dat->pwm)) {
 			dev_err(&pdev->dev, "unable to request PWM %d\n",
 					cur_led->pwm_id);
diff --git a/include/linux/leds_pwm.h b/include/linux/leds_pwm.h
index 33a0711..dbc925a 100644
--- a/include/linux/leds_pwm.h
+++ b/include/linux/leds_pwm.h
@@ -14,8 +14,9 @@ struct led_pwm {
 };
 
 struct led_pwm_platform_data {
-	int			num_leds;
+	int		num_leds;
 	struct led_pwm	*leds;
+	char		*name;
 };
 
 #endif
-- 
1.7.2.dirty

  parent reply	other threads:[~2010-10-05 11:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-05 11:59 [PATCHv2 0/7] PWM core driver for pwm based led and backlight driver Arun Murthy
2010-10-05 11:59 ` [PATCHv2 1/7] pwm: Add pwm core driver Arun Murthy
2010-10-05 19:22   ` Andrew Morton
2010-10-06  4:03     ` Arun MURTHY
2010-10-06 19:45       ` Kevin Hilman
2010-10-05 11:59 ` [PATCHv2 2/7] backlight:pwm: add an element 'name' to platform data Arun Murthy
2010-10-05 11:59 ` Arun Murthy [this message]
2010-10-05 11:59 ` [PATCHv2 4/7] pwm: Align existing pwm drivers with pwm-core driver Arun Murthy
2010-10-05 12:00 ` [PATCHv2 5/7] platform: Update the pwm based led and backlight platform data Arun Murthy
2010-10-05 12:00 ` [PATCHv2 6/7] pwm: move existing pwm driver to drivers/pwm Arun Murthy
2010-10-05 12:00 ` [PATCHv2 7/7] pwm: Modify backlight and led Kconfig aligning to pwm core Arun Murthy
2010-10-05 15:05 ` [PATCHv2 0/7] PWM core driver for pwm based led and backlight driver Kevin Hilman
2010-10-06  3:46   ` Arun MURTHY

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1286280002-1636-4-git-send-email-arun.murthy@stericsson.com \
    --to=arun.murthy@stericsson.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).