Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jingoo Han and committed by
Bryan Wu
87aae1ea 8465b018

+52 -49
+1 -1
drivers/leds/leds-88pm860x.c
··· 157 157 static int pm860x_led_probe(struct platform_device *pdev) 158 158 { 159 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 161 struct pm860x_led *data; 162 162 struct resource *res; 163 163 int ret = 0;
+3 -3
drivers/leds/leds-adp5520.c
··· 87 87 88 88 static 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 91 struct device *dev = pdev->dev.parent; 92 92 int ret = 0; 93 93 ··· 103 103 104 104 static 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 107 struct adp5520_led *led, *led_dat; 108 108 struct led_info *cur_led; 109 109 int ret, i; ··· 185 185 186 186 static 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 189 struct adp5520_led *led; 190 190 int i; 191 191
+2 -2
drivers/leds/leds-asic3.c
··· 94 94 95 95 static 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 98 int ret; 99 99 100 100 ret = mfd_cell_enable(pdev); ··· 127 127 128 128 static 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 132 led_classdev_unregister(led->cdev); 133 133
+2 -2
drivers/leds/leds-atmel-pwm.c
··· 42 42 int i; 43 43 int status; 44 44 45 - pdata = pdev->dev.platform_data; 45 + pdata = dev_get_platdata(&pdev->dev); 46 46 if (!pdata || pdata->num_leds < 1) 47 47 return -ENODEV; 48 48 ··· 119 119 struct pwmled *leds; 120 120 unsigned i; 121 121 122 - pdata = pdev->dev.platform_data; 122 + pdata = dev_get_platdata(&pdev->dev); 123 123 leds = platform_get_drvdata(pdev); 124 124 125 125 for (i = 0; i < pdata->num_leds; i++) {
+1 -1
drivers/leds/leds-bd2802.c
··· 684 684 } 685 685 686 686 led->client = client; 687 - pdata = led->pdata = client->dev.platform_data; 687 + pdata = led->pdata = dev_get_platdata(&client->dev); 688 688 i2c_set_clientdata(client, led); 689 689 690 690 /* Configure RESET GPIO (L: RESET, H: RESET cancel) */
+1 -1
drivers/leds/leds-da903x.c
··· 93 93 94 94 static 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 97 struct da903x_led *led; 98 98 int id, ret; 99 99
+2 -2
drivers/leds/leds-da9052.c
··· 112 112 int i; 113 113 114 114 da9052 = dev_get_drvdata(pdev->dev.parent); 115 - pdata = da9052->dev->platform_data; 115 + pdata = dev_get_platdata(da9052->dev); 116 116 if (pdata == NULL) { 117 117 dev_err(&pdev->dev, "No platform data\n"); 118 118 goto err; ··· 185 185 int i; 186 186 187 187 da9052 = dev_get_drvdata(pdev->dev.parent); 188 - pdata = da9052->dev->platform_data; 188 + pdata = dev_get_platdata(da9052->dev); 189 189 pled = pdata->pled; 190 190 191 191 for (i = 0; i < pled->num_leds; i++) {
+1 -1
drivers/leds/leds-gpio.c
··· 233 233 234 234 static 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 237 struct gpio_leds_priv *priv; 238 238 int i, ret = 0; 239 239
+1 -1
drivers/leds/leds-lm3530.c
··· 403 403 static int lm3530_probe(struct i2c_client *client, 404 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 407 struct lm3530_data *drvdata; 408 408 int err = 0; 409 409
+1 -1
drivers/leds/leds-lm3533.c
··· 671 671 if (!lm3533) 672 672 return -EINVAL; 673 673 674 - pdata = pdev->dev.platform_data; 674 + pdata = dev_get_platdata(&pdev->dev); 675 675 if (!pdata) { 676 676 dev_err(&pdev->dev, "no platform data\n"); 677 677 return -EINVAL;
+1 -1
drivers/leds/leds-lm355x.c
··· 423 423 static int lm355x_probe(struct i2c_client *client, 424 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 427 struct lm355x_chip_data *chip; 428 428 429 429 int err;
+1 -1
drivers/leds/leds-lm3642.c
··· 316 316 static int lm3642_probe(struct i2c_client *client, 317 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 320 struct lm3642_chip_data *chip; 321 321 322 322 int err;
+3 -2
drivers/leds/leds-lp3944.c
··· 377 377 static int lp3944_probe(struct i2c_client *client, 378 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 382 struct lp3944_data *data; 382 383 int err; 383 384 ··· 414 413 415 414 static int lp3944_remove(struct i2c_client *client) 416 415 { 417 - struct lp3944_platform_data *pdata = client->dev.platform_data; 416 + struct lp3944_platform_data *pdata = dev_get_platdata(&client->dev); 418 417 struct lp3944_data *data = i2c_get_clientdata(client); 419 418 int i; 420 419
+2 -2
drivers/leds/leds-lp5521.c
··· 420 420 struct lp55xx_platform_data *pdata; 421 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 424 if (np) { 425 425 ret = lp55xx_of_populate_pdata(&client->dev, np); 426 426 if (ret < 0) ··· 430 430 return -EINVAL; 431 431 } 432 432 } 433 - pdata = client->dev.platform_data; 433 + pdata = dev_get_platdata(&client->dev); 434 434 435 435 chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); 436 436 if (!chip)
+2 -2
drivers/leds/leds-lp5523.c
··· 432 432 struct lp55xx_platform_data *pdata; 433 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 436 if (np) { 437 437 ret = lp55xx_of_populate_pdata(&client->dev, np); 438 438 if (ret < 0) ··· 442 442 return -EINVAL; 443 443 } 444 444 } 445 - pdata = client->dev.platform_data; 445 + pdata = dev_get_platdata(&client->dev); 446 446 447 447 chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); 448 448 if (!chip)
+2 -2
drivers/leds/leds-lp5562.c
··· 518 518 struct lp55xx_platform_data *pdata; 519 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 522 if (np) { 523 523 ret = lp55xx_of_populate_pdata(&client->dev, np); 524 524 if (ret < 0) ··· 528 528 return -EINVAL; 529 529 } 530 530 } 531 - pdata = client->dev.platform_data; 531 + pdata = dev_get_platdata(&client->dev); 532 532 533 533 chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); 534 534 if (!chip)
+2 -2
drivers/leds/leds-lp8501.c
··· 310 310 struct lp55xx_platform_data *pdata; 311 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 314 if (np) { 315 315 ret = lp55xx_of_populate_pdata(&client->dev, np); 316 316 if (ret < 0) ··· 320 320 return -EINVAL; 321 321 } 322 322 } 323 - pdata = client->dev.platform_data; 323 + pdata = dev_get_platdata(&client->dev); 324 324 325 325 chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); 326 326 if (!chip)
+2 -2
drivers/leds/leds-lt3593.c
··· 135 135 136 136 static 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 139 struct lt3593_led_data *leds_data; 140 140 int i, ret = 0; 141 141 ··· 169 169 static int lt3593_led_remove(struct platform_device *pdev) 170 170 { 171 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 173 struct lt3593_led_data *leds_data; 174 174 175 175 leds_data = platform_get_drvdata(pdev);
+3 -3
drivers/leds/leds-netxbig.c
··· 306 306 struct netxbig_led_data *led_dat, 307 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 310 int ret; 311 311 312 312 spin_lock_init(&led_dat->lock); ··· 354 354 355 355 static 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 358 struct netxbig_led_data *leds_data; 359 359 int i; 360 360 int ret; ··· 391 391 392 392 static 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 395 struct netxbig_led_data *leds_data; 396 396 int i; 397 397
+1 -1
drivers/leds/leds-ns2.c
··· 321 321 322 322 static 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 325 struct ns2_led_priv *priv; 326 326 int i; 327 327 int ret;
+2 -1
drivers/leds/leds-pca9532.c
··· 446 446 const struct i2c_device_id *id) 447 447 { 448 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 452 if (!pca9532_pdata) 452 453 return -EIO;
+1 -1
drivers/leds/leds-pca955x.c
··· 267 267 268 268 chip = &pca955x_chipdefs[id->driver_data]; 269 269 adapter = to_i2c_adapter(client->dev.parent); 270 - pdata = client->dev.platform_data; 270 + pdata = dev_get_platdata(&client->dev); 271 271 272 272 /* Make sure the slave address / chip type combo given is possible */ 273 273 if ((client->addr & ~((1 << chip->slv_addr_shift) - 1)) !=
+1 -1
drivers/leds/leds-pca9633.c
··· 287 287 struct pca9633_platform_data *pdata; 288 288 int i, err; 289 289 290 - pdata = client->dev.platform_data; 290 + pdata = dev_get_platdata(&client->dev); 291 291 292 292 if (!pdata) { 293 293 pdata = pca9633_dt_init(client);
+1 -1
drivers/leds/leds-pwm.c
··· 147 147 148 148 static 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 151 struct led_pwm_priv *priv; 152 152 int i, ret = 0; 153 153
+2 -1
drivers/leds/leds-regulator.c
··· 142 142 143 143 static 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 147 struct regulator_led *led; 147 148 struct regulator *vcc; 148 149 int ret = 0;
+6 -6
drivers/leds/leds-renesas-tpu.c
··· 65 65 66 66 static 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 69 void __iomem *base = p->mapbase; 70 70 unsigned long offs = reg_nr << 2; 71 71 ··· 77 77 78 78 static 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 81 void __iomem *base = p->mapbase; 82 82 unsigned long offs = reg_nr << 2; 83 83 ··· 91 91 92 92 static 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 95 unsigned long flags; 96 96 u16 value; 97 97 ··· 110 110 111 111 static 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 114 int prescaler[] = { 1, 4, 16, 64 }; 115 115 int k, ret; 116 116 unsigned long rate, tmp; ··· 190 190 static void r_tpu_set_pin(struct r_tpu_priv *p, enum r_tpu_pin new_state, 191 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 195 if (p->pin_state == new_state) { 196 196 if (p->pin_state == R_TPU_PIN_GPIO) ··· 241 241 242 242 static 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 245 struct r_tpu_priv *p; 246 246 struct resource *res; 247 247 int ret;
+1 -1
drivers/leds/leds-s3c24xx.c
··· 71 71 72 72 static 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 75 struct s3c24xx_gpio_led *led; 76 76 int ret; 77 77
+1 -1
drivers/leds/leds-tca6507.c
··· 737 737 int i = 0; 738 738 739 739 adapter = to_i2c_adapter(client->dev.parent); 740 - pdata = client->dev.platform_data; 740 + pdata = dev_get_platdata(&client->dev); 741 741 742 742 if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) 743 743 return -EIO;
+2 -2
drivers/leds/leds-wm831x-status.c
··· 246 246 drvdata->wm831x = wm831x; 247 247 drvdata->reg = res->start; 248 248 249 - if (wm831x->dev->platform_data) 250 - chip_pdata = wm831x->dev->platform_data; 249 + if (dev_get_platdata(wm831x->dev)) 250 + chip_pdata = dev_get_platdata(wm831x->dev); 251 251 else 252 252 chip_pdata = NULL; 253 253
+1 -1
drivers/leds/leds-wm8350.c
··· 203 203 { 204 204 struct regulator *isink, *dcdc; 205 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 207 int i; 208 208 209 209 if (pdata == NULL) {