diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-11-12 18:09:04 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-12 22:09:16 -0500 |
commit | c512794cada491e008eeca822af7e4ad5db72a56 (patch) | |
tree | 08b65bb08c7387e45b6bc0d2c4b849ad6b921df5 | |
parent | 1f299997b460d08356006945345a8962f7ecd719 (diff) |
backlight: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change to
make the code simpler and enhance the readability.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
32 files changed, 44 insertions, 46 deletions
diff --git a/drivers/video/backlight/88pm860x_bl.c b/drivers/video/backlight/88pm860x_bl.c index 2cd63507ed74..a84a12a6bf91 100644 --- a/drivers/video/backlight/88pm860x_bl.c +++ b/drivers/video/backlight/88pm860x_bl.c | |||
@@ -196,7 +196,7 @@ static int pm860x_backlight_dt_init(struct platform_device *pdev, | |||
196 | static int pm860x_backlight_probe(struct platform_device *pdev) | 196 | static int pm860x_backlight_probe(struct platform_device *pdev) |
197 | { | 197 | { |
198 | struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); | 198 | struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); |
199 | struct pm860x_backlight_pdata *pdata = pdev->dev.platform_data; | 199 | struct pm860x_backlight_pdata *pdata = dev_get_platdata(&pdev->dev); |
200 | struct pm860x_backlight_data *data; | 200 | struct pm860x_backlight_data *data; |
201 | struct backlight_device *bl; | 201 | struct backlight_device *bl; |
202 | struct resource *res; | 202 | struct resource *res; |
diff --git a/drivers/video/backlight/aat2870_bl.c b/drivers/video/backlight/aat2870_bl.c index c6fc668d6236..c68232b8b7de 100644 --- a/drivers/video/backlight/aat2870_bl.c +++ b/drivers/video/backlight/aat2870_bl.c | |||
@@ -127,7 +127,7 @@ static const struct backlight_ops aat2870_bl_ops = { | |||
127 | 127 | ||
128 | static int aat2870_bl_probe(struct platform_device *pdev) | 128 | static int aat2870_bl_probe(struct platform_device *pdev) |
129 | { | 129 | { |
130 | struct aat2870_bl_platform_data *pdata = pdev->dev.platform_data; | 130 | struct aat2870_bl_platform_data *pdata = dev_get_platdata(&pdev->dev); |
131 | struct aat2870_bl_driver_data *aat2870_bl; | 131 | struct aat2870_bl_driver_data *aat2870_bl; |
132 | struct backlight_device *bd; | 132 | struct backlight_device *bd; |
133 | struct backlight_properties props; | 133 | struct backlight_properties props; |
diff --git a/drivers/video/backlight/adp5520_bl.c b/drivers/video/backlight/adp5520_bl.c index c84701b7ca6e..fe8e3d1c9798 100644 --- a/drivers/video/backlight/adp5520_bl.c +++ b/drivers/video/backlight/adp5520_bl.c | |||
@@ -297,7 +297,7 @@ static int adp5520_bl_probe(struct platform_device *pdev) | |||
297 | return -ENOMEM; | 297 | return -ENOMEM; |
298 | 298 | ||
299 | data->master = pdev->dev.parent; | 299 | data->master = pdev->dev.parent; |
300 | data->pdata = pdev->dev.platform_data; | 300 | data->pdata = dev_get_platdata(&pdev->dev); |
301 | 301 | ||
302 | if (data->pdata == NULL) { | 302 | if (data->pdata == NULL) { |
303 | dev_err(&pdev->dev, "missing platform data\n"); | 303 | dev_err(&pdev->dev, "missing platform data\n"); |
diff --git a/drivers/video/backlight/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c index 75b10f876127..2f77f37fac3c 100644 --- a/drivers/video/backlight/adp8860_bl.c +++ b/drivers/video/backlight/adp8860_bl.c | |||
@@ -216,7 +216,7 @@ static int adp8860_led_setup(struct adp8860_led *led) | |||
216 | static int adp8860_led_probe(struct i2c_client *client) | 216 | static int adp8860_led_probe(struct i2c_client *client) |
217 | { | 217 | { |
218 | struct adp8860_backlight_platform_data *pdata = | 218 | struct adp8860_backlight_platform_data *pdata = |
219 | client->dev.platform_data; | 219 | dev_get_platdata(&client->dev); |
220 | struct adp8860_bl *data = i2c_get_clientdata(client); | 220 | struct adp8860_bl *data = i2c_get_clientdata(client); |
221 | struct adp8860_led *led, *led_dat; | 221 | struct adp8860_led *led, *led_dat; |
222 | struct led_info *cur_led; | 222 | struct led_info *cur_led; |
@@ -300,7 +300,7 @@ static int adp8860_led_probe(struct i2c_client *client) | |||
300 | static int adp8860_led_remove(struct i2c_client *client) | 300 | static int adp8860_led_remove(struct i2c_client *client) |
301 | { | 301 | { |
302 | struct adp8860_backlight_platform_data *pdata = | 302 | struct adp8860_backlight_platform_data *pdata = |
303 | client->dev.platform_data; | 303 | dev_get_platdata(&client->dev); |
304 | struct adp8860_bl *data = i2c_get_clientdata(client); | 304 | struct adp8860_bl *data = i2c_get_clientdata(client); |
305 | int i; | 305 | int i; |
306 | 306 | ||
@@ -658,7 +658,7 @@ static int adp8860_probe(struct i2c_client *client, | |||
658 | struct backlight_device *bl; | 658 | struct backlight_device *bl; |
659 | struct adp8860_bl *data; | 659 | struct adp8860_bl *data; |
660 | struct adp8860_backlight_platform_data *pdata = | 660 | struct adp8860_backlight_platform_data *pdata = |
661 | client->dev.platform_data; | 661 | dev_get_platdata(&client->dev); |
662 | struct backlight_properties props; | 662 | struct backlight_properties props; |
663 | uint8_t reg_val; | 663 | uint8_t reg_val; |
664 | int ret; | 664 | int ret; |
diff --git a/drivers/video/backlight/adp8870_bl.c b/drivers/video/backlight/adp8870_bl.c index 90049d7b5c60..9eee69fea49d 100644 --- a/drivers/video/backlight/adp8870_bl.c +++ b/drivers/video/backlight/adp8870_bl.c | |||
@@ -238,7 +238,7 @@ static int adp8870_led_setup(struct adp8870_led *led) | |||
238 | static int adp8870_led_probe(struct i2c_client *client) | 238 | static int adp8870_led_probe(struct i2c_client *client) |
239 | { | 239 | { |
240 | struct adp8870_backlight_platform_data *pdata = | 240 | struct adp8870_backlight_platform_data *pdata = |
241 | client->dev.platform_data; | 241 | dev_get_platdata(&client->dev); |
242 | struct adp8870_bl *data = i2c_get_clientdata(client); | 242 | struct adp8870_bl *data = i2c_get_clientdata(client); |
243 | struct adp8870_led *led, *led_dat; | 243 | struct adp8870_led *led, *led_dat; |
244 | struct led_info *cur_led; | 244 | struct led_info *cur_led; |
@@ -325,7 +325,7 @@ static int adp8870_led_probe(struct i2c_client *client) | |||
325 | static int adp8870_led_remove(struct i2c_client *client) | 325 | static int adp8870_led_remove(struct i2c_client *client) |
326 | { | 326 | { |
327 | struct adp8870_backlight_platform_data *pdata = | 327 | struct adp8870_backlight_platform_data *pdata = |
328 | client->dev.platform_data; | 328 | dev_get_platdata(&client->dev); |
329 | struct adp8870_bl *data = i2c_get_clientdata(client); | 329 | struct adp8870_bl *data = i2c_get_clientdata(client); |
330 | int i; | 330 | int i; |
331 | 331 | ||
@@ -848,7 +848,7 @@ static int adp8870_probe(struct i2c_client *client, | |||
848 | struct backlight_device *bl; | 848 | struct backlight_device *bl; |
849 | struct adp8870_bl *data; | 849 | struct adp8870_bl *data; |
850 | struct adp8870_backlight_platform_data *pdata = | 850 | struct adp8870_backlight_platform_data *pdata = |
851 | client->dev.platform_data; | 851 | dev_get_platdata(&client->dev); |
852 | uint8_t reg_val; | 852 | uint8_t reg_val; |
853 | int ret; | 853 | int ret; |
854 | 854 | ||
diff --git a/drivers/video/backlight/ams369fg06.c b/drivers/video/backlight/ams369fg06.c index 319fef6cb422..df5507b2b492 100644 --- a/drivers/video/backlight/ams369fg06.c +++ b/drivers/video/backlight/ams369fg06.c | |||
@@ -471,7 +471,7 @@ static int ams369fg06_probe(struct spi_device *spi) | |||
471 | lcd->spi = spi; | 471 | lcd->spi = spi; |
472 | lcd->dev = &spi->dev; | 472 | lcd->dev = &spi->dev; |
473 | 473 | ||
474 | lcd->lcd_pd = spi->dev.platform_data; | 474 | lcd->lcd_pd = dev_get_platdata(&spi->dev); |
475 | if (!lcd->lcd_pd) { | 475 | if (!lcd->lcd_pd) { |
476 | dev_err(&spi->dev, "platform data is NULL\n"); | 476 | dev_err(&spi->dev, "platform data is NULL\n"); |
477 | return -EINVAL; | 477 | return -EINVAL; |
diff --git a/drivers/video/backlight/atmel-pwm-bl.c b/drivers/video/backlight/atmel-pwm-bl.c index f7447f7004fb..c11121e9176b 100644 --- a/drivers/video/backlight/atmel-pwm-bl.c +++ b/drivers/video/backlight/atmel-pwm-bl.c | |||
@@ -133,7 +133,7 @@ static int atmel_pwm_bl_probe(struct platform_device *pdev) | |||
133 | 133 | ||
134 | pwmbl->pdev = pdev; | 134 | pwmbl->pdev = pdev; |
135 | 135 | ||
136 | pdata = pdev->dev.platform_data; | 136 | pdata = dev_get_platdata(&pdev->dev); |
137 | if (!pdata) { | 137 | if (!pdata) { |
138 | retval = -ENODEV; | 138 | retval = -ENODEV; |
139 | goto err_free_mem; | 139 | goto err_free_mem; |
diff --git a/drivers/video/backlight/bd6107.c b/drivers/video/backlight/bd6107.c index 15e3294b29fe..43c434e7dc86 100644 --- a/drivers/video/backlight/bd6107.c +++ b/drivers/video/backlight/bd6107.c | |||
@@ -128,7 +128,7 @@ static const struct backlight_ops bd6107_backlight_ops = { | |||
128 | static int bd6107_probe(struct i2c_client *client, | 128 | static int bd6107_probe(struct i2c_client *client, |
129 | const struct i2c_device_id *id) | 129 | const struct i2c_device_id *id) |
130 | { | 130 | { |
131 | struct bd6107_platform_data *pdata = client->dev.platform_data; | 131 | struct bd6107_platform_data *pdata = dev_get_platdata(&client->dev); |
132 | struct backlight_device *backlight; | 132 | struct backlight_device *backlight; |
133 | struct backlight_properties props; | 133 | struct backlight_properties props; |
134 | struct bd6107 *bd; | 134 | struct bd6107 *bd; |
diff --git a/drivers/video/backlight/corgi_lcd.c b/drivers/video/backlight/corgi_lcd.c index c97867a717a7..be56cfe03845 100644 --- a/drivers/video/backlight/corgi_lcd.c +++ b/drivers/video/backlight/corgi_lcd.c | |||
@@ -533,7 +533,7 @@ static int setup_gpio_backlight(struct corgi_lcd *lcd, | |||
533 | static int corgi_lcd_probe(struct spi_device *spi) | 533 | static int corgi_lcd_probe(struct spi_device *spi) |
534 | { | 534 | { |
535 | struct backlight_properties props; | 535 | struct backlight_properties props; |
536 | struct corgi_lcd_platform_data *pdata = spi->dev.platform_data; | 536 | struct corgi_lcd_platform_data *pdata = dev_get_platdata(&spi->dev); |
537 | struct corgi_lcd *lcd; | 537 | struct corgi_lcd *lcd; |
538 | int ret = 0; | 538 | int ret = 0; |
539 | 539 | ||
diff --git a/drivers/video/backlight/da903x_bl.c b/drivers/video/backlight/da903x_bl.c index 67cadd30e273..bbad5c21ed9e 100644 --- a/drivers/video/backlight/da903x_bl.c +++ b/drivers/video/backlight/da903x_bl.c | |||
@@ -109,7 +109,7 @@ static const struct backlight_ops da903x_backlight_ops = { | |||
109 | 109 | ||
110 | static int da903x_backlight_probe(struct platform_device *pdev) | 110 | static int da903x_backlight_probe(struct platform_device *pdev) |
111 | { | 111 | { |
112 | struct da9034_backlight_pdata *pdata = pdev->dev.platform_data; | 112 | struct da9034_backlight_pdata *pdata = dev_get_platdata(&pdev->dev); |
113 | struct da903x_backlight_data *data; | 113 | struct da903x_backlight_data *data; |
114 | struct backlight_device *bl; | 114 | struct backlight_device *bl; |
115 | struct backlight_properties props; | 115 | struct backlight_properties props; |
diff --git a/drivers/video/backlight/generic_bl.c b/drivers/video/backlight/generic_bl.c index 19e393b41438..48fa9146958b 100644 --- a/drivers/video/backlight/generic_bl.c +++ b/drivers/video/backlight/generic_bl.c | |||
@@ -79,7 +79,7 @@ static const struct backlight_ops genericbl_ops = { | |||
79 | static int genericbl_probe(struct platform_device *pdev) | 79 | static int genericbl_probe(struct platform_device *pdev) |
80 | { | 80 | { |
81 | struct backlight_properties props; | 81 | struct backlight_properties props; |
82 | struct generic_bl_info *machinfo = pdev->dev.platform_data; | 82 | struct generic_bl_info *machinfo = dev_get_platdata(&pdev->dev); |
83 | const char *name = "generic-bl"; | 83 | const char *name = "generic-bl"; |
84 | struct backlight_device *bd; | 84 | struct backlight_device *bd; |
85 | 85 | ||
diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index 5fa217f9f445..118da0c6386f 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c | |||
@@ -62,7 +62,8 @@ static const struct backlight_ops gpio_backlight_ops = { | |||
62 | 62 | ||
63 | static int gpio_backlight_probe(struct platform_device *pdev) | 63 | static int gpio_backlight_probe(struct platform_device *pdev) |
64 | { | 64 | { |
65 | struct gpio_backlight_platform_data *pdata = pdev->dev.platform_data; | 65 | struct gpio_backlight_platform_data *pdata = |
66 | dev_get_platdata(&pdev->dev); | ||
66 | struct backlight_properties props; | 67 | struct backlight_properties props; |
67 | struct backlight_device *bl; | 68 | struct backlight_device *bl; |
68 | struct gpio_backlight *gbl; | 69 | struct gpio_backlight *gbl; |
diff --git a/drivers/video/backlight/ili9320.c b/drivers/video/backlight/ili9320.c index f8be90c5dedc..4dd43e079a8d 100644 --- a/drivers/video/backlight/ili9320.c +++ b/drivers/video/backlight/ili9320.c | |||
@@ -198,7 +198,7 @@ static void ili9320_setup_spi(struct ili9320 *ili, | |||
198 | int ili9320_probe_spi(struct spi_device *spi, | 198 | int ili9320_probe_spi(struct spi_device *spi, |
199 | struct ili9320_client *client) | 199 | struct ili9320_client *client) |
200 | { | 200 | { |
201 | struct ili9320_platdata *cfg = spi->dev.platform_data; | 201 | struct ili9320_platdata *cfg = dev_get_platdata(&spi->dev); |
202 | struct device *dev = &spi->dev; | 202 | struct device *dev = &spi->dev; |
203 | struct ili9320 *ili; | 203 | struct ili9320 *ili; |
204 | struct lcd_device *lcd; | 204 | struct lcd_device *lcd; |
diff --git a/drivers/video/backlight/kb3886_bl.c b/drivers/video/backlight/kb3886_bl.c index bca6ccc74dfb..5bacabb233d6 100644 --- a/drivers/video/backlight/kb3886_bl.c +++ b/drivers/video/backlight/kb3886_bl.c | |||
@@ -141,7 +141,7 @@ static const struct backlight_ops kb3886bl_ops = { | |||
141 | static int kb3886bl_probe(struct platform_device *pdev) | 141 | static int kb3886bl_probe(struct platform_device *pdev) |
142 | { | 142 | { |
143 | struct backlight_properties props; | 143 | struct backlight_properties props; |
144 | struct kb3886bl_machinfo *machinfo = pdev->dev.platform_data; | 144 | struct kb3886bl_machinfo *machinfo = dev_get_platdata(&pdev->dev); |
145 | 145 | ||
146 | bl_machinfo = machinfo; | 146 | bl_machinfo = machinfo; |
147 | if (!machinfo->limit_mask) | 147 | if (!machinfo->limit_mask) |
diff --git a/drivers/video/backlight/l4f00242t03.c b/drivers/video/backlight/l4f00242t03.c index a35a38c709cf..923eae2f85f8 100644 --- a/drivers/video/backlight/l4f00242t03.c +++ b/drivers/video/backlight/l4f00242t03.c | |||
@@ -48,7 +48,7 @@ static void l4f00242t03_reset(unsigned int gpio) | |||
48 | 48 | ||
49 | static void l4f00242t03_lcd_init(struct spi_device *spi) | 49 | static void l4f00242t03_lcd_init(struct spi_device *spi) |
50 | { | 50 | { |
51 | struct l4f00242t03_pdata *pdata = spi->dev.platform_data; | 51 | struct l4f00242t03_pdata *pdata = dev_get_platdata(&spi->dev); |
52 | struct l4f00242t03_priv *priv = spi_get_drvdata(spi); | 52 | struct l4f00242t03_priv *priv = spi_get_drvdata(spi); |
53 | const u16 cmd[] = { 0x36, param(0), 0x3A, param(0x60) }; | 53 | const u16 cmd[] = { 0x36, param(0), 0x3A, param(0x60) }; |
54 | int ret; | 54 | int ret; |
@@ -88,7 +88,7 @@ static void l4f00242t03_lcd_init(struct spi_device *spi) | |||
88 | 88 | ||
89 | static void l4f00242t03_lcd_powerdown(struct spi_device *spi) | 89 | static void l4f00242t03_lcd_powerdown(struct spi_device *spi) |
90 | { | 90 | { |
91 | struct l4f00242t03_pdata *pdata = spi->dev.platform_data; | 91 | struct l4f00242t03_pdata *pdata = dev_get_platdata(&spi->dev); |
92 | struct l4f00242t03_priv *priv = spi_get_drvdata(spi); | 92 | struct l4f00242t03_priv *priv = spi_get_drvdata(spi); |
93 | 93 | ||
94 | dev_dbg(&spi->dev, "Powering down LCD\n"); | 94 | dev_dbg(&spi->dev, "Powering down LCD\n"); |
@@ -171,7 +171,7 @@ static struct lcd_ops l4f_ops = { | |||
171 | static int l4f00242t03_probe(struct spi_device *spi) | 171 | static int l4f00242t03_probe(struct spi_device *spi) |
172 | { | 172 | { |
173 | struct l4f00242t03_priv *priv; | 173 | struct l4f00242t03_priv *priv; |
174 | struct l4f00242t03_pdata *pdata = spi->dev.platform_data; | 174 | struct l4f00242t03_pdata *pdata = dev_get_platdata(&spi->dev); |
175 | int ret; | 175 | int ret; |
176 | 176 | ||
177 | if (pdata == NULL) { | 177 | if (pdata == NULL) { |
diff --git a/drivers/video/backlight/ld9040.c b/drivers/video/backlight/ld9040.c index 1e0a3093ce50..26d5139b0696 100644 --- a/drivers/video/backlight/ld9040.c +++ b/drivers/video/backlight/ld9040.c | |||
@@ -702,7 +702,7 @@ static int ld9040_probe(struct spi_device *spi) | |||
702 | lcd->spi = spi; | 702 | lcd->spi = spi; |
703 | lcd->dev = &spi->dev; | 703 | lcd->dev = &spi->dev; |
704 | 704 | ||
705 | lcd->lcd_pd = spi->dev.platform_data; | 705 | lcd->lcd_pd = dev_get_platdata(&spi->dev); |
706 | if (!lcd->lcd_pd) { | 706 | if (!lcd->lcd_pd) { |
707 | dev_err(&spi->dev, "platform data is NULL.\n"); | 707 | dev_err(&spi->dev, "platform data is NULL.\n"); |
708 | return -EINVAL; | 708 | return -EINVAL; |
diff --git a/drivers/video/backlight/lm3533_bl.c b/drivers/video/backlight/lm3533_bl.c index 1d1dbfb789e3..93eea65f4cf9 100644 --- a/drivers/video/backlight/lm3533_bl.c +++ b/drivers/video/backlight/lm3533_bl.c | |||
@@ -284,7 +284,7 @@ static int lm3533_bl_probe(struct platform_device *pdev) | |||
284 | if (!lm3533) | 284 | if (!lm3533) |
285 | return -EINVAL; | 285 | return -EINVAL; |
286 | 286 | ||
287 | pdata = pdev->dev.platform_data; | 287 | pdata = dev_get_platdata(&pdev->dev); |
288 | if (!pdata) { | 288 | if (!pdata) { |
289 | dev_err(&pdev->dev, "no platform data\n"); | 289 | dev_err(&pdev->dev, "no platform data\n"); |
290 | return -EINVAL; | 290 | return -EINVAL; |
diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c index 1128a022e1d3..999075a48863 100644 --- a/drivers/video/backlight/lm3630a_bl.c +++ b/drivers/video/backlight/lm3630a_bl.c | |||
@@ -365,7 +365,7 @@ static const struct regmap_config lm3630a_regmap = { | |||
365 | static int lm3630a_probe(struct i2c_client *client, | 365 | static int lm3630a_probe(struct i2c_client *client, |
366 | const struct i2c_device_id *id) | 366 | const struct i2c_device_id *id) |
367 | { | 367 | { |
368 | struct lm3630a_platform_data *pdata = client->dev.platform_data; | 368 | struct lm3630a_platform_data *pdata = dev_get_platdata(&client->dev); |
369 | struct lm3630a_chip *pchip; | 369 | struct lm3630a_chip *pchip; |
370 | int rval; | 370 | int rval; |
371 | 371 | ||
diff --git a/drivers/video/backlight/lm3639_bl.c b/drivers/video/backlight/lm3639_bl.c index 6c888e39e4cd..6fd60adf922e 100644 --- a/drivers/video/backlight/lm3639_bl.c +++ b/drivers/video/backlight/lm3639_bl.c | |||
@@ -307,7 +307,7 @@ static int lm3639_probe(struct i2c_client *client, | |||
307 | { | 307 | { |
308 | int ret; | 308 | int ret; |
309 | struct lm3639_chip_data *pchip; | 309 | struct lm3639_chip_data *pchip; |
310 | struct lm3639_platform_data *pdata = client->dev.platform_data; | 310 | struct lm3639_platform_data *pdata = dev_get_platdata(&client->dev); |
311 | struct backlight_properties props; | 311 | struct backlight_properties props; |
312 | 312 | ||
313 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { | 313 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { |
diff --git a/drivers/video/backlight/lms283gf05.c b/drivers/video/backlight/lms283gf05.c index 4eec47261cd3..80b5929d4872 100644 --- a/drivers/video/backlight/lms283gf05.c +++ b/drivers/video/backlight/lms283gf05.c | |||
@@ -128,7 +128,7 @@ static int lms283gf05_power_set(struct lcd_device *ld, int power) | |||
128 | { | 128 | { |
129 | struct lms283gf05_state *st = lcd_get_data(ld); | 129 | struct lms283gf05_state *st = lcd_get_data(ld); |
130 | struct spi_device *spi = st->spi; | 130 | struct spi_device *spi = st->spi; |
131 | struct lms283gf05_pdata *pdata = spi->dev.platform_data; | 131 | struct lms283gf05_pdata *pdata = dev_get_platdata(&spi->dev); |
132 | 132 | ||
133 | if (power <= FB_BLANK_NORMAL) { | 133 | if (power <= FB_BLANK_NORMAL) { |
134 | if (pdata) | 134 | if (pdata) |
@@ -153,7 +153,7 @@ static struct lcd_ops lms_ops = { | |||
153 | static int lms283gf05_probe(struct spi_device *spi) | 153 | static int lms283gf05_probe(struct spi_device *spi) |
154 | { | 154 | { |
155 | struct lms283gf05_state *st; | 155 | struct lms283gf05_state *st; |
156 | struct lms283gf05_pdata *pdata = spi->dev.platform_data; | 156 | struct lms283gf05_pdata *pdata = dev_get_platdata(&spi->dev); |
157 | struct lcd_device *ld; | 157 | struct lcd_device *ld; |
158 | int ret = 0; | 158 | int ret = 0; |
159 | 159 | ||
diff --git a/drivers/video/backlight/lms501kf03.c b/drivers/video/backlight/lms501kf03.c index cf01b9ac8131..ff46e194a117 100644 --- a/drivers/video/backlight/lms501kf03.c +++ b/drivers/video/backlight/lms501kf03.c | |||
@@ -344,7 +344,7 @@ static int lms501kf03_probe(struct spi_device *spi) | |||
344 | lcd->spi = spi; | 344 | lcd->spi = spi; |
345 | lcd->dev = &spi->dev; | 345 | lcd->dev = &spi->dev; |
346 | 346 | ||
347 | lcd->lcd_pd = spi->dev.platform_data; | 347 | lcd->lcd_pd = dev_get_platdata(&spi->dev); |
348 | if (!lcd->lcd_pd) { | 348 | if (!lcd->lcd_pd) { |
349 | dev_err(&spi->dev, "platform data is NULL\n"); | 349 | dev_err(&spi->dev, "platform data is NULL\n"); |
350 | return -EINVAL; | 350 | return -EINVAL; |
diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c index c952175d4113..57f005a9b475 100644 --- a/drivers/video/backlight/lp855x_bl.c +++ b/drivers/video/backlight/lp855x_bl.c | |||
@@ -405,7 +405,7 @@ static int lp855x_parse_dt(struct device *dev, struct device_node *node) | |||
405 | static int lp855x_probe(struct i2c_client *cl, const struct i2c_device_id *id) | 405 | static int lp855x_probe(struct i2c_client *cl, const struct i2c_device_id *id) |
406 | { | 406 | { |
407 | struct lp855x *lp; | 407 | struct lp855x *lp; |
408 | struct lp855x_platform_data *pdata = cl->dev.platform_data; | 408 | struct lp855x_platform_data *pdata = dev_get_platdata(&cl->dev); |
409 | struct device_node *node = cl->dev.of_node; | 409 | struct device_node *node = cl->dev.of_node; |
410 | int ret; | 410 | int ret; |
411 | 411 | ||
@@ -414,7 +414,7 @@ static int lp855x_probe(struct i2c_client *cl, const struct i2c_device_id *id) | |||
414 | if (ret < 0) | 414 | if (ret < 0) |
415 | return ret; | 415 | return ret; |
416 | 416 | ||
417 | pdata = cl->dev.platform_data; | 417 | pdata = dev_get_platdata(&cl->dev); |
418 | } | 418 | } |
419 | 419 | ||
420 | if (!i2c_check_functionality(cl->adapter, I2C_FUNC_SMBUS_I2C_BLOCK)) | 420 | if (!i2c_check_functionality(cl->adapter, I2C_FUNC_SMBUS_I2C_BLOCK)) |
diff --git a/drivers/video/backlight/lv5207lp.c b/drivers/video/backlight/lv5207lp.c index 498fd73d59b9..8091a28b2405 100644 --- a/drivers/video/backlight/lv5207lp.c +++ b/drivers/video/backlight/lv5207lp.c | |||
@@ -93,7 +93,7 @@ static const struct backlight_ops lv5207lp_backlight_ops = { | |||
93 | static int lv5207lp_probe(struct i2c_client *client, | 93 | static int lv5207lp_probe(struct i2c_client *client, |
94 | const struct i2c_device_id *id) | 94 | const struct i2c_device_id *id) |
95 | { | 95 | { |
96 | struct lv5207lp_platform_data *pdata = client->dev.platform_data; | 96 | struct lv5207lp_platform_data *pdata = dev_get_platdata(&client->dev); |
97 | struct backlight_device *backlight; | 97 | struct backlight_device *backlight; |
98 | struct backlight_properties props; | 98 | struct backlight_properties props; |
99 | struct lv5207lp *lv; | 99 | struct lv5207lp *lv; |
diff --git a/drivers/video/backlight/omap1_bl.c b/drivers/video/backlight/omap1_bl.c index 812e22e35cab..ac11a4650c19 100644 --- a/drivers/video/backlight/omap1_bl.c +++ b/drivers/video/backlight/omap1_bl.c | |||
@@ -133,7 +133,7 @@ static int omapbl_probe(struct platform_device *pdev) | |||
133 | struct backlight_properties props; | 133 | struct backlight_properties props; |
134 | struct backlight_device *dev; | 134 | struct backlight_device *dev; |
135 | struct omap_backlight *bl; | 135 | struct omap_backlight *bl; |
136 | struct omap_backlight_config *pdata = pdev->dev.platform_data; | 136 | struct omap_backlight_config *pdata = dev_get_platdata(&pdev->dev); |
137 | 137 | ||
138 | if (!pdata) | 138 | if (!pdata) |
139 | return -ENXIO; | 139 | return -ENXIO; |
diff --git a/drivers/video/backlight/pcf50633-backlight.c b/drivers/video/backlight/pcf50633-backlight.c index 6ed76be18f19..b2184cf70b92 100644 --- a/drivers/video/backlight/pcf50633-backlight.c +++ b/drivers/video/backlight/pcf50633-backlight.c | |||
@@ -103,7 +103,7 @@ static int pcf50633_bl_probe(struct platform_device *pdev) | |||
103 | { | 103 | { |
104 | struct pcf50633_bl *pcf_bl; | 104 | struct pcf50633_bl *pcf_bl; |
105 | struct device *parent = pdev->dev.parent; | 105 | struct device *parent = pdev->dev.parent; |
106 | struct pcf50633_platform_data *pcf50633_data = parent->platform_data; | 106 | struct pcf50633_platform_data *pcf50633_data = dev_get_platdata(parent); |
107 | struct pcf50633_bl_platform_data *pdata = pcf50633_data->backlight_data; | 107 | struct pcf50633_bl_platform_data *pdata = pcf50633_data->backlight_data; |
108 | struct backlight_properties bl_props; | 108 | struct backlight_properties bl_props; |
109 | 109 | ||
diff --git a/drivers/video/backlight/platform_lcd.c b/drivers/video/backlight/platform_lcd.c index 056836706708..cc0f0675366e 100644 --- a/drivers/video/backlight/platform_lcd.c +++ b/drivers/video/backlight/platform_lcd.c | |||
@@ -80,7 +80,7 @@ static int platform_lcd_probe(struct platform_device *pdev) | |||
80 | struct device *dev = &pdev->dev; | 80 | struct device *dev = &pdev->dev; |
81 | int err; | 81 | int err; |
82 | 82 | ||
83 | pdata = pdev->dev.platform_data; | 83 | pdata = dev_get_platdata(&pdev->dev); |
84 | if (!pdata) { | 84 | if (!pdata) { |
85 | dev_err(dev, "no platform data supplied\n"); | 85 | dev_err(dev, "no platform data supplied\n"); |
86 | return -EINVAL; | 86 | return -EINVAL; |
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 1fea627394d7..36db5d98dd2f 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c | |||
@@ -163,7 +163,7 @@ static int pwm_backlight_parse_dt(struct device *dev, | |||
163 | 163 | ||
164 | static int pwm_backlight_probe(struct platform_device *pdev) | 164 | static int pwm_backlight_probe(struct platform_device *pdev) |
165 | { | 165 | { |
166 | struct platform_pwm_backlight_data *data = pdev->dev.platform_data; | 166 | struct platform_pwm_backlight_data *data = dev_get_platdata(&pdev->dev); |
167 | struct platform_pwm_backlight_data defdata; | 167 | struct platform_pwm_backlight_data defdata; |
168 | struct backlight_properties props; | 168 | struct backlight_properties props; |
169 | struct backlight_device *bl; | 169 | struct backlight_device *bl; |
diff --git a/drivers/video/backlight/s6e63m0.c b/drivers/video/backlight/s6e63m0.c index b37bb1854bf4..4e339adc1f57 100644 --- a/drivers/video/backlight/s6e63m0.c +++ b/drivers/video/backlight/s6e63m0.c | |||
@@ -735,7 +735,7 @@ static int s6e63m0_probe(struct spi_device *spi) | |||
735 | lcd->spi = spi; | 735 | lcd->spi = spi; |
736 | lcd->dev = &spi->dev; | 736 | lcd->dev = &spi->dev; |
737 | 737 | ||
738 | lcd->lcd_pd = spi->dev.platform_data; | 738 | lcd->lcd_pd = dev_get_platdata(&spi->dev); |
739 | if (!lcd->lcd_pd) { | 739 | if (!lcd->lcd_pd) { |
740 | dev_err(&spi->dev, "platform data is NULL.\n"); | 740 | dev_err(&spi->dev, "platform data is NULL.\n"); |
741 | return -EINVAL; | 741 | return -EINVAL; |
diff --git a/drivers/video/backlight/tdo24m.c b/drivers/video/backlight/tdo24m.c index 18cdf466d50a..2ccfa46eee7c 100644 --- a/drivers/video/backlight/tdo24m.c +++ b/drivers/video/backlight/tdo24m.c | |||
@@ -338,7 +338,7 @@ static int tdo24m_probe(struct spi_device *spi) | |||
338 | enum tdo24m_model model; | 338 | enum tdo24m_model model; |
339 | int err; | 339 | int err; |
340 | 340 | ||
341 | pdata = spi->dev.platform_data; | 341 | pdata = dev_get_platdata(&spi->dev); |
342 | if (pdata) | 342 | if (pdata) |
343 | model = pdata->model; | 343 | model = pdata->model; |
344 | else | 344 | else |
diff --git a/drivers/video/backlight/tosa_bl.c b/drivers/video/backlight/tosa_bl.c index 9df66ac68b34..b8db9338cacd 100644 --- a/drivers/video/backlight/tosa_bl.c +++ b/drivers/video/backlight/tosa_bl.c | |||
@@ -38,7 +38,7 @@ struct tosa_bl_data { | |||
38 | 38 | ||
39 | static void tosa_bl_set_backlight(struct tosa_bl_data *data, int brightness) | 39 | static void tosa_bl_set_backlight(struct tosa_bl_data *data, int brightness) |
40 | { | 40 | { |
41 | struct spi_device *spi = data->i2c->dev.platform_data; | 41 | struct spi_device *spi = dev_get_platdata(&data->i2c->dev); |
42 | 42 | ||
43 | i2c_smbus_write_byte_data(data->i2c, DAC_CH1, data->comadj); | 43 | i2c_smbus_write_byte_data(data->i2c, DAC_CH1, data->comadj); |
44 | 44 | ||
diff --git a/drivers/video/backlight/tps65217_bl.c b/drivers/video/backlight/tps65217_bl.c index 05782312aeb3..4ea20394e951 100644 --- a/drivers/video/backlight/tps65217_bl.c +++ b/drivers/video/backlight/tps65217_bl.c | |||
@@ -287,12 +287,11 @@ static int tps65217_bl_probe(struct platform_device *pdev) | |||
287 | if (IS_ERR(pdata)) | 287 | if (IS_ERR(pdata)) |
288 | return PTR_ERR(pdata); | 288 | return PTR_ERR(pdata); |
289 | } else { | 289 | } else { |
290 | if (!pdev->dev.platform_data) { | 290 | pdata = dev_get_platdata(&pdev->dev); |
291 | if (!pdata) { | ||
291 | dev_err(&pdev->dev, "no platform data provided\n"); | 292 | dev_err(&pdev->dev, "no platform data provided\n"); |
292 | return -EINVAL; | 293 | return -EINVAL; |
293 | } | 294 | } |
294 | |||
295 | pdata = pdev->dev.platform_data; | ||
296 | } | 295 | } |
297 | 296 | ||
298 | tps65217_bl = devm_kzalloc(&pdev->dev, sizeof(*tps65217_bl), | 297 | tps65217_bl = devm_kzalloc(&pdev->dev, sizeof(*tps65217_bl), |
diff --git a/drivers/video/backlight/wm831x_bl.c b/drivers/video/backlight/wm831x_bl.c index 9e5517a3a52b..2ccf3206e93f 100644 --- a/drivers/video/backlight/wm831x_bl.c +++ b/drivers/video/backlight/wm831x_bl.c | |||
@@ -123,7 +123,7 @@ static const struct backlight_ops wm831x_backlight_ops = { | |||
123 | static int wm831x_backlight_probe(struct platform_device *pdev) | 123 | static int wm831x_backlight_probe(struct platform_device *pdev) |
124 | { | 124 | { |
125 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); | 125 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); |
126 | struct wm831x_pdata *wm831x_pdata; | 126 | struct wm831x_pdata *wm831x_pdata = dev_get_platdata(pdev->dev.parent); |
127 | struct wm831x_backlight_pdata *pdata; | 127 | struct wm831x_backlight_pdata *pdata; |
128 | struct wm831x_backlight_data *data; | 128 | struct wm831x_backlight_data *data; |
129 | struct backlight_device *bl; | 129 | struct backlight_device *bl; |
@@ -131,12 +131,10 @@ static int wm831x_backlight_probe(struct platform_device *pdev) | |||
131 | int ret, i, max_isel, isink_reg, dcdc_cfg; | 131 | int ret, i, max_isel, isink_reg, dcdc_cfg; |
132 | 132 | ||
133 | /* We need platform data */ | 133 | /* We need platform data */ |
134 | if (pdev->dev.parent->platform_data) { | 134 | if (wm831x_pdata) |
135 | wm831x_pdata = pdev->dev.parent->platform_data; | ||
136 | pdata = wm831x_pdata->backlight; | 135 | pdata = wm831x_pdata->backlight; |
137 | } else { | 136 | else |
138 | pdata = NULL; | 137 | pdata = NULL; |
139 | } | ||
140 | 138 | ||
141 | if (!pdata) { | 139 | if (!pdata) { |
142 | dev_err(&pdev->dev, "No platform data supplied\n"); | 140 | dev_err(&pdev->dev, "No platform data supplied\n"); |