linux-mips
[Top] [All Lists]

[PATCHv2 3/7] leds: pwm: add a new element 'name' to platform data

To: <lars@metafoo.de>, <akpm@linux-foundation.org>, <kernel@pengutronix.de>, <philipp.zabel@gmail.com>, <robert.jarzmik@free.fr>, <marek.vasut@gmail.com>, <eric.y.miao@gmail.com>, <rpurdie@rpsys.net>, <sameo@linux.intel.com>, <kgene.kim@samsung.com>, <linux-omap@vger.kernel.org>
Subject: [PATCHv2 3/7] leds: pwm: add a new element 'name' to platform data
From: Arun Murthy <arun.murthy@stericsson.com>
Date: Tue, 5 Oct 2010 17:29:58 +0530
Cc: <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org>, <linux-mips@linux-mips.org>, <STEricsson_nomadik_linux@list.st.com>, <arun.murthy@stericsson.com>, <bgat@billgatliff.com>
In-reply-to: <1286280002-1636-1-git-send-email-arun.murthy@stericsson.com>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1286280002-1636-1-git-send-email-arun.murthy@stericsson.com>
Sender: linux-mips-bounce@linux-mips.org
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


<Prev in Thread] Current Thread [Next in Thread>