aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-07-30 04:07:35 -0400
committerBryan Wu <cooloney@gmail.com>2013-08-26 20:22:11 -0400
commit87aae1ea82f93f0f00cb955044ea1db3501cf233 (patch)
tree5230c5f9bf6e78259a61656d7065b3c4386afd02 /drivers
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')
-rw-r--r--drivers/leds/leds-88pm860x.c2
-rw-r--r--drivers/leds/leds-adp5520.c6
-rw-r--r--drivers/leds/leds-asic3.c4
-rw-r--r--drivers/leds/leds-atmel-pwm.c4
-rw-r--r--drivers/leds/leds-bd2802.c2
-rw-r--r--drivers/leds/leds-da903x.c2
-rw-r--r--drivers/leds/leds-da9052.c4
-rw-r--r--drivers/leds/leds-gpio.c2
-rw-r--r--drivers/leds/leds-lm3530.c2
-rw-r--r--drivers/leds/leds-lm3533.c2
-rw-r--r--drivers/leds/leds-lm355x.c2
-rw-r--r--drivers/leds/leds-lm3642.c2
-rw-r--r--drivers/leds/leds-lp3944.c5
-rw-r--r--drivers/leds/leds-lp5521.c4
-rw-r--r--drivers/leds/leds-lp5523.c4
-rw-r--r--drivers/leds/leds-lp5562.c4
-rw-r--r--drivers/leds/leds-lp8501.c4
-rw-r--r--drivers/leds/leds-lt3593.c4
-rw-r--r--drivers/leds/leds-netxbig.c6
-rw-r--r--drivers/leds/leds-ns2.c2
-rw-r--r--drivers/leds/leds-pca9532.c3
-rw-r--r--drivers/leds/leds-pca955x.c2
-rw-r--r--drivers/leds/leds-pca9633.c2
-rw-r--r--drivers/leds/leds-pwm.c2
-rw-r--r--drivers/leds/leds-regulator.c3
-rw-r--r--drivers/leds/leds-renesas-tpu.c12
-rw-r--r--drivers/leds/leds-s3c24xx.c2
-rw-r--r--drivers/leds/leds-tca6507.c2
-rw-r--r--drivers/leds/leds-wm831x-status.c4
-rw-r--r--drivers/leds/leds-wm8350.c2
30 files changed, 52 insertions, 49 deletions
diff --git a/drivers/leds/leds-88pm860x.c b/drivers/leds/leds-88pm860x.c
index 232b3ce902e5..5f588c0a376e 100644
--- a/drivers/leds/leds-88pm860x.c
+++ b/drivers/leds/leds-88pm860x.c
@@ -157,7 +157,7 @@ static int pm860x_led_dt_init(struct platform_device *pdev,
157static int pm860x_led_probe(struct platform_device *pdev) 157static int pm860x_led_probe(struct platform_device *pdev)
158{ 158{
159 struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); 159 struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent);
160 struct pm860x_led_pdata *pdata = pdev->dev.platform_data; 160 struct pm860x_led_pdata *pdata = dev_get_platdata(&pdev->dev);
161 struct pm860x_led *data; 161 struct pm860x_led *data;
162 struct resource *res; 162 struct resource *res;
163 int ret = 0; 163 int ret = 0;
diff --git a/drivers/leds/leds-adp5520.c b/drivers/leds/leds-adp5520.c
index e8072abe76e5..7e311a120b11 100644
--- a/drivers/leds/leds-adp5520.c
+++ b/drivers/leds/leds-adp5520.c
@@ -87,7 +87,7 @@ static int adp5520_led_setup(struct adp5520_led *led)
87 87
88static int adp5520_led_prepare(struct platform_device *pdev) 88static int adp5520_led_prepare(struct platform_device *pdev)
89{ 89{
90 struct adp5520_leds_platform_data *pdata = pdev->dev.platform_data; 90 struct adp5520_leds_platform_data *pdata = dev_get_platdata(&pdev->dev);
91 struct device *dev = pdev->dev.parent; 91 struct device *dev = pdev->dev.parent;
92 int ret = 0; 92 int ret = 0;
93 93
@@ -103,7 +103,7 @@ static int adp5520_led_prepare(struct platform_device *pdev)
103 103
104static int adp5520_led_probe(struct platform_device *pdev) 104static int adp5520_led_probe(struct platform_device *pdev)
105{ 105{
106 struct adp5520_leds_platform_data *pdata = pdev->dev.platform_data; 106 struct adp5520_leds_platform_data *pdata = dev_get_platdata(&pdev->dev);
107 struct adp5520_led *led, *led_dat; 107 struct adp5520_led *led, *led_dat;
108 struct led_info *cur_led; 108 struct led_info *cur_led;
109 int ret, i; 109 int ret, i;
@@ -185,7 +185,7 @@ err:
185 185
186static int adp5520_led_remove(struct platform_device *pdev) 186static int adp5520_led_remove(struct platform_device *pdev)
187{ 187{
188 struct adp5520_leds_platform_data *pdata = pdev->dev.platform_data; 188 struct adp5520_leds_platform_data *pdata = dev_get_platdata(&pdev->dev);
189 struct adp5520_led *led; 189 struct adp5520_led *led;
190 int i; 190 int i;
191 191
diff --git a/drivers/leds/leds-asic3.c b/drivers/leds/leds-asic3.c
index cf9efe421c2b..6de216a89a0c 100644
--- a/drivers/leds/leds-asic3.c
+++ b/drivers/leds/leds-asic3.c
@@ -94,7 +94,7 @@ static int blink_set(struct led_classdev *cdev,
94 94
95static int asic3_led_probe(struct platform_device *pdev) 95static int asic3_led_probe(struct platform_device *pdev)
96{ 96{
97 struct asic3_led *led = pdev->dev.platform_data; 97 struct asic3_led *led = dev_get_platdata(&pdev->dev);
98 int ret; 98 int ret;
99 99
100 ret = mfd_cell_enable(pdev); 100 ret = mfd_cell_enable(pdev);
@@ -127,7 +127,7 @@ out:
127 127
128static int asic3_led_remove(struct platform_device *pdev) 128static int asic3_led_remove(struct platform_device *pdev)
129{ 129{
130 struct asic3_led *led = pdev->dev.platform_data; 130 struct asic3_led *led = dev_get_platdata(&pdev->dev);
131 131
132 led_classdev_unregister(led->cdev); 132 led_classdev_unregister(led->cdev);
133 133
diff --git a/drivers/leds/leds-atmel-pwm.c b/drivers/leds/leds-atmel-pwm.c
index 90518f84b9c0..56cec8d6a2ac 100644
--- a/drivers/leds/leds-atmel-pwm.c
+++ b/drivers/leds/leds-atmel-pwm.c
@@ -42,7 +42,7 @@ static int pwmled_probe(struct platform_device *pdev)
42 int i; 42 int i;
43 int status; 43 int status;
44 44
45 pdata = pdev->dev.platform_data; 45 pdata = dev_get_platdata(&pdev->dev);
46 if (!pdata || pdata->num_leds < 1) 46 if (!pdata || pdata->num_leds < 1)
47 return -ENODEV; 47 return -ENODEV;
48 48
@@ -119,7 +119,7 @@ static int pwmled_remove(struct platform_device *pdev)
119 struct pwmled *leds; 119 struct pwmled *leds;
120 unsigned i; 120 unsigned i;
121 121
122 pdata = pdev->dev.platform_data; 122 pdata = dev_get_platdata(&pdev->dev);
123 leds = platform_get_drvdata(pdev); 123 leds = platform_get_drvdata(pdev);
124 124
125 for (i = 0; i < pdata->num_leds; i++) { 125 for (i = 0; i < pdata->num_leds; i++) {
diff --git a/drivers/leds/leds-bd2802.c b/drivers/leds/leds-bd2802.c
index 2db04231a792..fb5a3472d614 100644
--- a/drivers/leds/leds-bd2802.c
+++ b/drivers/leds/leds-bd2802.c
@@ -684,7 +684,7 @@ static int bd2802_probe(struct i2c_client *client,
684 } 684 }
685 685
686 led->client = client; 686 led->client = client;
687 pdata = led->pdata = client->dev.platform_data; 687 pdata = led->pdata = dev_get_platdata(&client->dev);
688 i2c_set_clientdata(client, led); 688 i2c_set_clientdata(client, led);
689 689
690 /* Configure RESET GPIO (L: RESET, H: RESET cancel) */ 690 /* Configure RESET GPIO (L: RESET, H: RESET cancel) */
diff --git a/drivers/leds/leds-da903x.c b/drivers/leds/leds-da903x.c
index c263a21db829..2a4b87f8091a 100644
--- a/drivers/leds/leds-da903x.c
+++ b/drivers/leds/leds-da903x.c
@@ -93,7 +93,7 @@ static void da903x_led_set(struct led_classdev *led_cdev,
93 93
94static int da903x_led_probe(struct platform_device *pdev) 94static int da903x_led_probe(struct platform_device *pdev)
95{ 95{
96 struct led_info *pdata = pdev->dev.platform_data; 96 struct led_info *pdata = dev_get_platdata(&pdev->dev);
97 struct da903x_led *led; 97 struct da903x_led *led;
98 int id, ret; 98 int id, ret;
99 99
diff --git a/drivers/leds/leds-da9052.c b/drivers/leds/leds-da9052.c
index efec43344e9f..865d4faf874a 100644
--- a/drivers/leds/leds-da9052.c
+++ b/drivers/leds/leds-da9052.c
@@ -112,7 +112,7 @@ static int da9052_led_probe(struct platform_device *pdev)
112 int i; 112 int i;
113 113
114 da9052 = dev_get_drvdata(pdev->dev.parent); 114 da9052 = dev_get_drvdata(pdev->dev.parent);
115 pdata = da9052->dev->platform_data; 115 pdata = dev_get_platdata(da9052->dev);
116 if (pdata == NULL) { 116 if (pdata == NULL) {
117 dev_err(&pdev->dev, "No platform data\n"); 117 dev_err(&pdev->dev, "No platform data\n");
118 goto err; 118 goto err;
@@ -185,7 +185,7 @@ static int da9052_led_remove(struct platform_device *pdev)
185 int i; 185 int i;
186 186
187 da9052 = dev_get_drvdata(pdev->dev.parent); 187 da9052 = dev_get_drvdata(pdev->dev.parent);
188 pdata = da9052->dev->platform_data; 188 pdata = dev_get_platdata(da9052->dev);
189 pled = pdata->pled; 189 pled = pdata->pled;
190 190
191 for (i = 0; i < pled->num_leds; i++) { 191 for (i = 0; i < pled->num_leds; i++) {
diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c
index 84d74c373cae..e8b01e57348d 100644
--- a/drivers/leds/leds-gpio.c
+++ b/drivers/leds/leds-gpio.c
@@ -233,7 +233,7 @@ static struct gpio_leds_priv *gpio_leds_create_of(struct platform_device *pdev)
233 233
234static int gpio_led_probe(struct platform_device *pdev) 234static int gpio_led_probe(struct platform_device *pdev)
235{ 235{
236 struct gpio_led_platform_data *pdata = pdev->dev.platform_data; 236 struct gpio_led_platform_data *pdata = dev_get_platdata(&pdev->dev);
237 struct gpio_leds_priv *priv; 237 struct gpio_leds_priv *priv;
238 int i, ret = 0; 238 int i, ret = 0;
239 239
diff --git a/drivers/leds/leds-lm3530.c b/drivers/leds/leds-lm3530.c
index a036a19040fe..652368c2ea9a 100644
--- a/drivers/leds/leds-lm3530.c
+++ b/drivers/leds/leds-lm3530.c
@@ -403,7 +403,7 @@ static DEVICE_ATTR(mode, 0644, lm3530_mode_get, lm3530_mode_set);
403static int lm3530_probe(struct i2c_client *client, 403static int lm3530_probe(struct i2c_client *client,
404 const struct i2c_device_id *id) 404 const struct i2c_device_id *id)
405{ 405{
406 struct lm3530_platform_data *pdata = client->dev.platform_data; 406 struct lm3530_platform_data *pdata = dev_get_platdata(&client->dev);
407 struct lm3530_data *drvdata; 407 struct lm3530_data *drvdata;
408 int err = 0; 408 int err = 0;
409 409
diff --git a/drivers/leds/leds-lm3533.c b/drivers/leds/leds-lm3533.c
index bbf24d038a7f..027ede73b80d 100644
--- a/drivers/leds/leds-lm3533.c
+++ b/drivers/leds/leds-lm3533.c
@@ -671,7 +671,7 @@ static int lm3533_led_probe(struct platform_device *pdev)
671 if (!lm3533) 671 if (!lm3533)
672 return -EINVAL; 672 return -EINVAL;
673 673
674 pdata = pdev->dev.platform_data; 674 pdata = dev_get_platdata(&pdev->dev);
675 if (!pdata) { 675 if (!pdata) {
676 dev_err(&pdev->dev, "no platform data\n"); 676 dev_err(&pdev->dev, "no platform data\n");
677 return -EINVAL; 677 return -EINVAL;
diff --git a/drivers/leds/leds-lm355x.c b/drivers/leds/leds-lm355x.c
index d81a8e7afd6c..591eb5e58ae3 100644
--- a/drivers/leds/leds-lm355x.c
+++ b/drivers/leds/leds-lm355x.c
@@ -423,7 +423,7 @@ static const struct regmap_config lm355x_regmap = {
423static int lm355x_probe(struct i2c_client *client, 423static int lm355x_probe(struct i2c_client *client,
424 const struct i2c_device_id *id) 424 const struct i2c_device_id *id)
425{ 425{
426 struct lm355x_platform_data *pdata = client->dev.platform_data; 426 struct lm355x_platform_data *pdata = dev_get_platdata(&client->dev);
427 struct lm355x_chip_data *chip; 427 struct lm355x_chip_data *chip;
428 428
429 int err; 429 int err;
diff --git a/drivers/leds/leds-lm3642.c b/drivers/leds/leds-lm3642.c
index f361bbef2dec..ceb6b3cde6fe 100644
--- a/drivers/leds/leds-lm3642.c
+++ b/drivers/leds/leds-lm3642.c
@@ -316,7 +316,7 @@ static const struct regmap_config lm3642_regmap = {
316static int lm3642_probe(struct i2c_client *client, 316static int lm3642_probe(struct i2c_client *client,
317 const struct i2c_device_id *id) 317 const struct i2c_device_id *id)
318{ 318{
319 struct lm3642_platform_data *pdata = client->dev.platform_data; 319 struct lm3642_platform_data *pdata = dev_get_platdata(&client->dev);
320 struct lm3642_chip_data *chip; 320 struct lm3642_chip_data *chip;
321 321
322 int err; 322 int err;
diff --git a/drivers/leds/leds-lp3944.c b/drivers/leds/leds-lp3944.c
index 0c4386e656c1..2b53d10e5607 100644
--- a/drivers/leds/leds-lp3944.c
+++ b/drivers/leds/leds-lp3944.c
@@ -377,7 +377,8 @@ exit:
377static int lp3944_probe(struct i2c_client *client, 377static int lp3944_probe(struct i2c_client *client,
378 const struct i2c_device_id *id) 378 const struct i2c_device_id *id)
379{ 379{
380 struct lp3944_platform_data *lp3944_pdata = client->dev.platform_data; 380 struct lp3944_platform_data *lp3944_pdata =
381 dev_get_platdata(&client->dev);
381 struct lp3944_data *data; 382 struct lp3944_data *data;
382 int err; 383 int err;
383 384
@@ -413,7 +414,7 @@ static int lp3944_probe(struct i2c_client *client,
413 414
414static int lp3944_remove(struct i2c_client *client) 415static int lp3944_remove(struct i2c_client *client)
415{ 416{
416 struct lp3944_platform_data *pdata = client->dev.platform_data; 417 struct lp3944_platform_data *pdata = dev_get_platdata(&client->dev);
417 struct lp3944_data *data = i2c_get_clientdata(client); 418 struct lp3944_data *data = i2c_get_clientdata(client);
418 int i; 419 int i;
419 420
diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c
index 1392feb1bcf7..9e28dd073e26 100644
--- a/drivers/leds/leds-lp5521.c
+++ b/drivers/leds/leds-lp5521.c
@@ -420,7 +420,7 @@ static int lp5521_probe(struct i2c_client *client,
420 struct lp55xx_platform_data *pdata; 420 struct lp55xx_platform_data *pdata;
421 struct device_node *np = client->dev.of_node; 421 struct device_node *np = client->dev.of_node;
422 422
423 if (!client->dev.platform_data) { 423 if (!dev_get_platdata(&client->dev)) {
424 if (np) { 424 if (np) {
425 ret = lp55xx_of_populate_pdata(&client->dev, np); 425 ret = lp55xx_of_populate_pdata(&client->dev, np);
426 if (ret < 0) 426 if (ret < 0)
@@ -430,7 +430,7 @@ static int lp5521_probe(struct i2c_client *client,
430 return -EINVAL; 430 return -EINVAL;
431 } 431 }
432 } 432 }
433 pdata = client->dev.platform_data; 433 pdata = dev_get_platdata(&client->dev);
434 434
435 chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); 435 chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
436 if (!chip) 436 if (!chip)
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
index 3979428f3100..72c10e2d4b02 100644
--- a/drivers/leds/leds-lp5523.c
+++ b/drivers/leds/leds-lp5523.c
@@ -432,7 +432,7 @@ static int lp5523_probe(struct i2c_client *client,
432 struct lp55xx_platform_data *pdata; 432 struct lp55xx_platform_data *pdata;
433 struct device_node *np = client->dev.of_node; 433 struct device_node *np = client->dev.of_node;
434 434
435 if (!client->dev.platform_data) { 435 if (!dev_get_platdata(&client->dev)) {
436 if (np) { 436 if (np) {
437 ret = lp55xx_of_populate_pdata(&client->dev, np); 437 ret = lp55xx_of_populate_pdata(&client->dev, np);
438 if (ret < 0) 438 if (ret < 0)
@@ -442,7 +442,7 @@ static int lp5523_probe(struct i2c_client *client,
442 return -EINVAL; 442 return -EINVAL;
443 } 443 }
444 } 444 }
445 pdata = client->dev.platform_data; 445 pdata = dev_get_platdata(&client->dev);
446 446
447 chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); 447 chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
448 if (!chip) 448 if (!chip)
diff --git a/drivers/leds/leds-lp5562.c b/drivers/leds/leds-lp5562.c
index cbd856dac150..a2c7398f1f55 100644
--- a/drivers/leds/leds-lp5562.c
+++ b/drivers/leds/leds-lp5562.c
@@ -518,7 +518,7 @@ static int lp5562_probe(struct i2c_client *client,
518 struct lp55xx_platform_data *pdata; 518 struct lp55xx_platform_data *pdata;
519 struct device_node *np = client->dev.of_node; 519 struct device_node *np = client->dev.of_node;
520 520
521 if (!client->dev.platform_data) { 521 if (!dev_get_platdata(&client->dev)) {
522 if (np) { 522 if (np) {
523 ret = lp55xx_of_populate_pdata(&client->dev, np); 523 ret = lp55xx_of_populate_pdata(&client->dev, np);
524 if (ret < 0) 524 if (ret < 0)
@@ -528,7 +528,7 @@ static int lp5562_probe(struct i2c_client *client,
528 return -EINVAL; 528 return -EINVAL;
529 } 529 }
530 } 530 }
531 pdata = client->dev.platform_data; 531 pdata = dev_get_platdata(&client->dev);
532 532
533 chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); 533 chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
534 if (!chip) 534 if (!chip)
diff --git a/drivers/leds/leds-lp8501.c b/drivers/leds/leds-lp8501.c
index 4573b9471aaa..8d55a780ca46 100644
--- a/drivers/leds/leds-lp8501.c
+++ b/drivers/leds/leds-lp8501.c
@@ -310,7 +310,7 @@ static int lp8501_probe(struct i2c_client *client,
310 struct lp55xx_platform_data *pdata; 310 struct lp55xx_platform_data *pdata;
311 struct device_node *np = client->dev.of_node; 311 struct device_node *np = client->dev.of_node;
312 312
313 if (!client->dev.platform_data) { 313 if (!dev_get_platdata(&client->dev)) {
314 if (np) { 314 if (np) {
315 ret = lp55xx_of_populate_pdata(&client->dev, np); 315 ret = lp55xx_of_populate_pdata(&client->dev, np);
316 if (ret < 0) 316 if (ret < 0)
@@ -320,7 +320,7 @@ static int lp8501_probe(struct i2c_client *client,
320 return -EINVAL; 320 return -EINVAL;
321 } 321 }
322 } 322 }
323 pdata = client->dev.platform_data; 323 pdata = dev_get_platdata(&client->dev);
324 324
325 chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); 325 chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
326 if (!chip) 326 if (!chip)
diff --git a/drivers/leds/leds-lt3593.c b/drivers/leds/leds-lt3593.c
index ca48a7d5502d..3417e5be7b57 100644
--- a/drivers/leds/leds-lt3593.c
+++ b/drivers/leds/leds-lt3593.c
@@ -135,7 +135,7 @@ static void delete_lt3593_led(struct lt3593_led_data *led)
135 135
136static int lt3593_led_probe(struct platform_device *pdev) 136static int lt3593_led_probe(struct platform_device *pdev)
137{ 137{
138 struct gpio_led_platform_data *pdata = pdev->dev.platform_data; 138 struct gpio_led_platform_data *pdata = dev_get_platdata(&pdev->dev);
139 struct lt3593_led_data *leds_data; 139 struct lt3593_led_data *leds_data;
140 int i, ret = 0; 140 int i, ret = 0;
141 141
@@ -169,7 +169,7 @@ err:
169static int lt3593_led_remove(struct platform_device *pdev) 169static int lt3593_led_remove(struct platform_device *pdev)
170{ 170{
171 int i; 171 int i;
172 struct gpio_led_platform_data *pdata = pdev->dev.platform_data; 172 struct gpio_led_platform_data *pdata = dev_get_platdata(&pdev->dev);
173 struct lt3593_led_data *leds_data; 173 struct lt3593_led_data *leds_data;
174 174
175 leds_data = platform_get_drvdata(pdev); 175 leds_data = platform_get_drvdata(pdev);
diff --git a/drivers/leds/leds-netxbig.c b/drivers/leds/leds-netxbig.c
index c61c5ebcc08e..2f9f141084ba 100644
--- a/drivers/leds/leds-netxbig.c
+++ b/drivers/leds/leds-netxbig.c
@@ -306,7 +306,7 @@ create_netxbig_led(struct platform_device *pdev,
306 struct netxbig_led_data *led_dat, 306 struct netxbig_led_data *led_dat,
307 const struct netxbig_led *template) 307 const struct netxbig_led *template)
308{ 308{
309 struct netxbig_led_platform_data *pdata = pdev->dev.platform_data; 309 struct netxbig_led_platform_data *pdata = dev_get_platdata(&pdev->dev);
310 int ret; 310 int ret;
311 311
312 spin_lock_init(&led_dat->lock); 312 spin_lock_init(&led_dat->lock);
@@ -354,7 +354,7 @@ create_netxbig_led(struct platform_device *pdev,
354 354
355static int netxbig_led_probe(struct platform_device *pdev) 355static int netxbig_led_probe(struct platform_device *pdev)
356{ 356{
357 struct netxbig_led_platform_data *pdata = pdev->dev.platform_data; 357 struct netxbig_led_platform_data *pdata = dev_get_platdata(&pdev->dev);
358 struct netxbig_led_data *leds_data; 358 struct netxbig_led_data *leds_data;
359 int i; 359 int i;
360 int ret; 360 int ret;
@@ -391,7 +391,7 @@ err_free_leds:
391 391
392static int netxbig_led_remove(struct platform_device *pdev) 392static int netxbig_led_remove(struct platform_device *pdev)
393{ 393{
394 struct netxbig_led_platform_data *pdata = pdev->dev.platform_data; 394 struct netxbig_led_platform_data *pdata = dev_get_platdata(&pdev->dev);
395 struct netxbig_led_data *leds_data; 395 struct netxbig_led_data *leds_data;
396 int i; 396 int i;
397 397
diff --git a/drivers/leds/leds-ns2.c b/drivers/leds/leds-ns2.c
index e7df9875c400..141f13438e80 100644
--- a/drivers/leds/leds-ns2.c
+++ b/drivers/leds/leds-ns2.c
@@ -321,7 +321,7 @@ static inline int sizeof_ns2_led_priv(int num_leds)
321 321
322static int ns2_led_probe(struct platform_device *pdev) 322static int ns2_led_probe(struct platform_device *pdev)
323{ 323{
324 struct ns2_led_platform_data *pdata = pdev->dev.platform_data; 324 struct ns2_led_platform_data *pdata = dev_get_platdata(&pdev->dev);
325 struct ns2_led_priv *priv; 325 struct ns2_led_priv *priv;
326 int i; 326 int i;
327 int ret; 327 int ret;
diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532.c
index 0c597bdd23f9..4a0e786b7832 100644
--- a/drivers/leds/leds-pca9532.c
+++ b/drivers/leds/leds-pca9532.c
@@ -446,7 +446,8 @@ static int pca9532_probe(struct i2c_client *client,
446 const struct i2c_device_id *id) 446 const struct i2c_device_id *id)
447{ 447{
448 struct pca9532_data *data = i2c_get_clientdata(client); 448 struct pca9532_data *data = i2c_get_clientdata(client);
449 struct pca9532_platform_data *pca9532_pdata = client->dev.platform_data; 449 struct pca9532_platform_data *pca9532_pdata =
450 dev_get_platdata(&client->dev);
450 451
451 if (!pca9532_pdata) 452 if (!pca9532_pdata)
452 return -EIO; 453 return -EIO;
diff --git a/drivers/leds/leds-pca955x.c b/drivers/leds/leds-pca955x.c
index edf485b773c8..c3a08b60535b 100644
--- a/drivers/leds/leds-pca955x.c
+++ b/drivers/leds/leds-pca955x.c
@@ -267,7 +267,7 @@ static int pca955x_probe(struct i2c_client *client,
267 267
268 chip = &pca955x_chipdefs[id->driver_data]; 268 chip = &pca955x_chipdefs[id->driver_data];
269 adapter = to_i2c_adapter(client->dev.parent); 269 adapter = to_i2c_adapter(client->dev.parent);
270 pdata = client->dev.platform_data; 270 pdata = dev_get_platdata(&client->dev);
271 271
272 /* Make sure the slave address / chip type combo given is possible */ 272 /* Make sure the slave address / chip type combo given is possible */
273 if ((client->addr & ~((1 << chip->slv_addr_shift) - 1)) != 273 if ((client->addr & ~((1 << chip->slv_addr_shift) - 1)) !=
diff --git a/drivers/leds/leds-pca9633.c b/drivers/leds/leds-pca9633.c
index 77b3f24b7207..ecd1449b1eb6 100644
--- a/drivers/leds/leds-pca9633.c
+++ b/drivers/leds/leds-pca9633.c
@@ -287,7 +287,7 @@ static int pca9633_probe(struct i2c_client *client,
287 struct pca9633_platform_data *pdata; 287 struct pca9633_platform_data *pdata;
288 int i, err; 288 int i, err;
289 289
290 pdata = client->dev.platform_data; 290 pdata = dev_get_platdata(&client->dev);
291 291
292 if (!pdata) { 292 if (!pdata) {
293 pdata = pca9633_dt_init(client); 293 pdata = pca9633_dt_init(client);
diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
index faf52c005e8c..bb6f94898541 100644
--- a/drivers/leds/leds-pwm.c
+++ b/drivers/leds/leds-pwm.c
@@ -147,7 +147,7 @@ err:
147 147
148static int led_pwm_probe(struct platform_device *pdev) 148static int led_pwm_probe(struct platform_device *pdev)
149{ 149{
150 struct led_pwm_platform_data *pdata = pdev->dev.platform_data; 150 struct led_pwm_platform_data *pdata = dev_get_platdata(&pdev->dev);
151 struct led_pwm_priv *priv; 151 struct led_pwm_priv *priv;
152 int i, ret = 0; 152 int i, ret = 0;
153 153
diff --git a/drivers/leds/leds-regulator.c b/drivers/leds/leds-regulator.c
index 4253a9b03dbf..358430db6e66 100644
--- a/drivers/leds/leds-regulator.c
+++ b/drivers/leds/leds-regulator.c
@@ -142,7 +142,8 @@ static void regulator_led_brightness_set(struct led_classdev *led_cdev,
142 142
143static int regulator_led_probe(struct platform_device *pdev) 143static int regulator_led_probe(struct platform_device *pdev)
144{ 144{
145 struct led_regulator_platform_data *pdata = pdev->dev.platform_data; 145 struct led_regulator_platform_data *pdata =
146 dev_get_platdata(&pdev->dev);
146 struct regulator_led *led; 147 struct regulator_led *led;
147 struct regulator *vcc; 148 struct regulator *vcc;
148 int ret = 0; 149 int ret = 0;
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);
65 65
66static inline u16 r_tpu_read(struct r_tpu_priv *p, int reg_nr) 66static inline u16 r_tpu_read(struct r_tpu_priv *p, int reg_nr)
67{ 67{
68 struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data; 68 struct led_renesas_tpu_config *cfg = dev_get_platdata(&p->pdev->dev);
69 void __iomem *base = p->mapbase; 69 void __iomem *base = p->mapbase;
70 unsigned long offs = reg_nr << 2; 70 unsigned long offs = reg_nr << 2;
71 71
@@ -77,7 +77,7 @@ static inline u16 r_tpu_read(struct r_tpu_priv *p, int reg_nr)
77 77
78static inline void r_tpu_write(struct r_tpu_priv *p, int reg_nr, u16 value) 78static inline void r_tpu_write(struct r_tpu_priv *p, int reg_nr, u16 value)
79{ 79{
80 struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data; 80 struct led_renesas_tpu_config *cfg = dev_get_platdata(&p->pdev->dev);
81 void __iomem *base = p->mapbase; 81 void __iomem *base = p->mapbase;
82 unsigned long offs = reg_nr << 2; 82 unsigned long offs = reg_nr << 2;
83 83
@@ -91,7 +91,7 @@ static inline void r_tpu_write(struct r_tpu_priv *p, int reg_nr, u16 value)
91 91
92static void r_tpu_start_stop_ch(struct r_tpu_priv *p, int start) 92static void r_tpu_start_stop_ch(struct r_tpu_priv *p, int start)
93{ 93{
94 struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data; 94 struct led_renesas_tpu_config *cfg = dev_get_platdata(&p->pdev->dev);
95 unsigned long flags; 95 unsigned long flags;
96 u16 value; 96 u16 value;
97 97
@@ -110,7 +110,7 @@ static void r_tpu_start_stop_ch(struct r_tpu_priv *p, int start)
110 110
111static int r_tpu_enable(struct r_tpu_priv *p, enum led_brightness brightness) 111static int r_tpu_enable(struct r_tpu_priv *p, enum led_brightness brightness)
112{ 112{
113 struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data; 113 struct led_renesas_tpu_config *cfg = dev_get_platdata(&p->pdev->dev);
114 int prescaler[] = { 1, 4, 16, 64 }; 114 int prescaler[] = { 1, 4, 16, 64 };
115 int k, ret; 115 int k, ret;
116 unsigned long rate, tmp; 116 unsigned long rate, tmp;
@@ -190,7 +190,7 @@ static void r_tpu_disable(struct r_tpu_priv *p)
190static void r_tpu_set_pin(struct r_tpu_priv *p, enum r_tpu_pin new_state, 190static void r_tpu_set_pin(struct r_tpu_priv *p, enum r_tpu_pin new_state,
191 enum led_brightness brightness) 191 enum led_brightness brightness)
192{ 192{
193 struct led_renesas_tpu_config *cfg = p->pdev->dev.platform_data; 193 struct led_renesas_tpu_config *cfg = dev_get_platdata(&p->pdev->dev);
194 194
195 if (p->pin_state == new_state) { 195 if (p->pin_state == new_state) {
196 if (p->pin_state == R_TPU_PIN_GPIO) 196 if (p->pin_state == R_TPU_PIN_GPIO)
@@ -241,7 +241,7 @@ static void r_tpu_set_brightness(struct led_classdev *ldev,
241 241
242static int r_tpu_probe(struct platform_device *pdev) 242static int r_tpu_probe(struct platform_device *pdev)
243{ 243{
244 struct led_renesas_tpu_config *cfg = pdev->dev.platform_data; 244 struct led_renesas_tpu_config *cfg = dev_get_platdata(&pdev->dev);
245 struct r_tpu_priv *p; 245 struct r_tpu_priv *p;
246 struct resource *res; 246 struct resource *res;
247 int ret; 247 int ret;
diff --git a/drivers/leds/leds-s3c24xx.c b/drivers/leds/leds-s3c24xx.c
index e1a0df63a37f..76483fb5ee45 100644
--- a/drivers/leds/leds-s3c24xx.c
+++ b/drivers/leds/leds-s3c24xx.c
@@ -71,7 +71,7 @@ static int s3c24xx_led_remove(struct platform_device *dev)
71 71
72static int s3c24xx_led_probe(struct platform_device *dev) 72static int s3c24xx_led_probe(struct platform_device *dev)
73{ 73{
74 struct s3c24xx_led_platdata *pdata = dev->dev.platform_data; 74 struct s3c24xx_led_platdata *pdata = dev_get_platdata(&dev->dev);
75 struct s3c24xx_gpio_led *led; 75 struct s3c24xx_gpio_led *led;
76 int ret; 76 int ret;
77 77
diff --git a/drivers/leds/leds-tca6507.c b/drivers/leds/leds-tca6507.c
index 98fe021ba276..8cc304f36728 100644
--- a/drivers/leds/leds-tca6507.c
+++ b/drivers/leds/leds-tca6507.c
@@ -737,7 +737,7 @@ static int tca6507_probe(struct i2c_client *client,
737 int i = 0; 737 int i = 0;
738 738
739 adapter = to_i2c_adapter(client->dev.parent); 739 adapter = to_i2c_adapter(client->dev.parent);
740 pdata = client->dev.platform_data; 740 pdata = dev_get_platdata(&client->dev);
741 741
742 if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) 742 if (!i2c_check_functionality(adapter, I2C_FUNC_I2C))
743 return -EIO; 743 return -EIO;
diff --git a/drivers/leds/leds-wm831x-status.c b/drivers/leds/leds-wm831x-status.c
index 120815a42701..c32dad4aedfb 100644
--- a/drivers/leds/leds-wm831x-status.c
+++ b/drivers/leds/leds-wm831x-status.c
@@ -246,8 +246,8 @@ static int wm831x_status_probe(struct platform_device *pdev)
246 drvdata->wm831x = wm831x; 246 drvdata->wm831x = wm831x;
247 drvdata->reg = res->start; 247 drvdata->reg = res->start;
248 248
249 if (wm831x->dev->platform_data) 249 if (dev_get_platdata(wm831x->dev))
250 chip_pdata = wm831x->dev->platform_data; 250 chip_pdata = dev_get_platdata(wm831x->dev);
251 else 251 else
252 chip_pdata = NULL; 252 chip_pdata = NULL;
253 253
diff --git a/drivers/leds/leds-wm8350.c b/drivers/leds/leds-wm8350.c
index 8a181d56602d..3f75fd22fd49 100644
--- a/drivers/leds/leds-wm8350.c
+++ b/drivers/leds/leds-wm8350.c
@@ -203,7 +203,7 @@ static int wm8350_led_probe(struct platform_device *pdev)
203{ 203{
204 struct regulator *isink, *dcdc; 204 struct regulator *isink, *dcdc;
205 struct wm8350_led *led; 205 struct wm8350_led *led;
206 struct wm8350_led_platform_data *pdata = pdev->dev.platform_data; 206 struct wm8350_led_platform_data *pdata = dev_get_platdata(&pdev->dev);
207 int i; 207 int i;
208 208
209 if (pdata == NULL) { 209 if (pdata == NULL) {