summaryrefslogtreecommitdiff
path: root/drivers/leds/leds-renesas-tpu.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-07-30 01:07:35 -0700
committerBryan Wu <cooloney@gmail.com>2013-08-26 17:22:11 -0700
commit87aae1ea82f93f0f00cb955044ea1db3501cf233 (patch)
tree5230c5f9bf6e78259a61656d7065b3c4386afd02 /drivers/leds/leds-renesas-tpu.c
parent8465b01827b7a1e0e2464b0a300618bf7add25d8 (diff)
leds: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of accessing dev->platform_data directly. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'drivers/leds/leds-renesas-tpu.c')
-rw-r--r--drivers/leds/leds-renesas-tpu.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/leds/leds-renesas-tpu.c b/drivers/leds/leds-renesas-tpu.c
index adebf4931e1e..397b92a282e7 100644
--- a/drivers/leds/leds-renesas-tpu.c
+++ b/drivers/leds/leds-renesas-tpu.c
@@ -65,7 +65,7 @@ static DEFINE_SPINLOCK(r_tpu_lock);
static inline u16 r_tpu_read(struct r_tpu_priv *p, int reg_nr)
{
- struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data;
+ struct led_renesas_tpu_config *cfg = dev_get_platdata(&p->pdev->dev);
void __iomem *base = p->mapbase;
unsigned long offs = reg_nr << 2;
@@ -77,7 +77,7 @@ static inline u16 r_tpu_read(struct r_tpu_priv *p, int reg_nr)
static inline void r_tpu_write(struct r_tpu_priv *p, int reg_nr, u16 value)
{
- struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data;
+ struct led_renesas_tpu_config *cfg = dev_get_platdata(&p->pdev->dev);
void __iomem *base = p->mapbase;
unsigned long offs = reg_nr << 2;
@@ -91,7 +91,7 @@ static inline void r_tpu_write(struct r_tpu_priv *p, int reg_nr, u16 value)
static void r_tpu_start_stop_ch(struct r_tpu_priv *p, int start)
{
- struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data;
+ struct led_renesas_tpu_config *cfg = dev_get_platdata(&p->pdev->dev);
unsigned long flags;
u16 value;
@@ -110,7 +110,7 @@ static void r_tpu_start_stop_ch(struct r_tpu_priv *p, int start)
static int r_tpu_enable(struct r_tpu_priv *p, enum led_brightness brightness)
{
- struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data;
+ struct led_renesas_tpu_config *cfg = dev_get_platdata(&p->pdev->dev);
int prescaler[] = { 1, 4, 16, 64 };
int k, ret;
unsigned long rate, tmp;
@@ -190,7 +190,7 @@ static void r_tpu_disable(struct r_tpu_priv *p)
static void r_tpu_set_pin(struct r_tpu_priv *p, enum r_tpu_pin new_state,
enum led_brightness brightness)
{
- struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data;
+ struct led_renesas_tpu_config *cfg = dev_get_platdata(&p->pdev->dev);
if (p->pin_state == new_state) {
if (p->pin_state == R_TPU_PIN_GPIO)
@@ -241,7 +241,7 @@ static void r_tpu_set_brightness(struct led_classdev *ldev,
static int r_tpu_probe(struct platform_device *pdev)
{
- struct led_renesas_tpu_config *cfg = pdev->dev.platform_data;
+ struct led_renesas_tpu_config *cfg = dev_get_platdata(&pdev->dev);
struct r_tpu_priv *p;
struct resource *res;
int ret;