diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-07-30 04:08:05 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-08-16 09:24:35 -0400 |
commit | e56aee1897fd27631c1cb28e12b0fb8f8f9736f7 (patch) | |
tree | e381b206fd8a6fd8ce2555fa1b02143e21dd1c46 /drivers/gpio | |
parent | c0e811d9f5d1ee708f06c4f0a1009f8a1d22f364 (diff) |
gpio: 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: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
31 files changed, 45 insertions, 42 deletions
diff --git a/drivers/gpio/gpio-74x164.c b/drivers/gpio/gpio-74x164.c index 721607904d0a..5d518d5db7a0 100644 --- a/drivers/gpio/gpio-74x164.c +++ b/drivers/gpio/gpio-74x164.c | |||
@@ -129,7 +129,7 @@ static int gen_74x164_probe(struct spi_device *spi) | |||
129 | if (!chip) | 129 | if (!chip) |
130 | return -ENOMEM; | 130 | return -ENOMEM; |
131 | 131 | ||
132 | pdata = spi->dev.platform_data; | 132 | pdata = dev_get_platdata(&spi->dev); |
133 | if (pdata && pdata->base) | 133 | if (pdata && pdata->base) |
134 | chip->gpio_chip.base = pdata->base; | 134 | chip->gpio_chip.base = pdata->base; |
135 | else | 135 | else |
diff --git a/drivers/gpio/gpio-adp5520.c b/drivers/gpio/gpio-adp5520.c index f33f78dcadaa..084337d5514d 100644 --- a/drivers/gpio/gpio-adp5520.c +++ b/drivers/gpio/gpio-adp5520.c | |||
@@ -89,7 +89,7 @@ static int adp5520_gpio_direction_output(struct gpio_chip *chip, | |||
89 | 89 | ||
90 | static int adp5520_gpio_probe(struct platform_device *pdev) | 90 | static int adp5520_gpio_probe(struct platform_device *pdev) |
91 | { | 91 | { |
92 | struct adp5520_gpio_platform_data *pdata = pdev->dev.platform_data; | 92 | struct adp5520_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev); |
93 | struct adp5520_gpio *dev; | 93 | struct adp5520_gpio *dev; |
94 | struct gpio_chip *gc; | 94 | struct gpio_chip *gc; |
95 | int ret, i, gpios; | 95 | int ret, i, gpios; |
diff --git a/drivers/gpio/gpio-adp5588.c b/drivers/gpio/gpio-adp5588.c index 2ba56987db04..90fc4c99c024 100644 --- a/drivers/gpio/gpio-adp5588.c +++ b/drivers/gpio/gpio-adp5588.c | |||
@@ -276,7 +276,8 @@ static irqreturn_t adp5588_irq_handler(int irq, void *devid) | |||
276 | static int adp5588_irq_setup(struct adp5588_gpio *dev) | 276 | static int adp5588_irq_setup(struct adp5588_gpio *dev) |
277 | { | 277 | { |
278 | struct i2c_client *client = dev->client; | 278 | struct i2c_client *client = dev->client; |
279 | struct adp5588_gpio_platform_data *pdata = client->dev.platform_data; | 279 | struct adp5588_gpio_platform_data *pdata = |
280 | dev_get_platdata(&client->dev); | ||
280 | unsigned gpio; | 281 | unsigned gpio; |
281 | int ret; | 282 | int ret; |
282 | 283 | ||
@@ -349,7 +350,8 @@ static void adp5588_irq_teardown(struct adp5588_gpio *dev) | |||
349 | static int adp5588_gpio_probe(struct i2c_client *client, | 350 | static int adp5588_gpio_probe(struct i2c_client *client, |
350 | const struct i2c_device_id *id) | 351 | const struct i2c_device_id *id) |
351 | { | 352 | { |
352 | struct adp5588_gpio_platform_data *pdata = client->dev.platform_data; | 353 | struct adp5588_gpio_platform_data *pdata = |
354 | dev_get_platdata(&client->dev); | ||
353 | struct adp5588_gpio *dev; | 355 | struct adp5588_gpio *dev; |
354 | struct gpio_chip *gc; | 356 | struct gpio_chip *gc; |
355 | int ret, i, revid; | 357 | int ret, i, revid; |
@@ -440,7 +442,8 @@ err: | |||
440 | 442 | ||
441 | static int adp5588_gpio_remove(struct i2c_client *client) | 443 | static int adp5588_gpio_remove(struct i2c_client *client) |
442 | { | 444 | { |
443 | struct adp5588_gpio_platform_data *pdata = client->dev.platform_data; | 445 | struct adp5588_gpio_platform_data *pdata = |
446 | dev_get_platdata(&client->dev); | ||
444 | struct adp5588_gpio *dev = i2c_get_clientdata(client); | 447 | struct adp5588_gpio *dev = i2c_get_clientdata(client); |
445 | int ret; | 448 | int ret; |
446 | 449 | ||
diff --git a/drivers/gpio/gpio-arizona.c b/drivers/gpio/gpio-arizona.c index 0ea853f68db2..fa8b6a762761 100644 --- a/drivers/gpio/gpio-arizona.c +++ b/drivers/gpio/gpio-arizona.c | |||
@@ -97,7 +97,7 @@ static struct gpio_chip template_chip = { | |||
97 | static int arizona_gpio_probe(struct platform_device *pdev) | 97 | static int arizona_gpio_probe(struct platform_device *pdev) |
98 | { | 98 | { |
99 | struct arizona *arizona = dev_get_drvdata(pdev->dev.parent); | 99 | struct arizona *arizona = dev_get_drvdata(pdev->dev.parent); |
100 | struct arizona_pdata *pdata = arizona->dev->platform_data; | 100 | struct arizona_pdata *pdata = dev_get_platdata(arizona->dev); |
101 | struct arizona_gpio *arizona_gpio; | 101 | struct arizona_gpio *arizona_gpio; |
102 | int ret; | 102 | int ret; |
103 | 103 | ||
diff --git a/drivers/gpio/gpio-da9052.c b/drivers/gpio/gpio-da9052.c index 29b11e9b6a78..9b77dc05d4ad 100644 --- a/drivers/gpio/gpio-da9052.c +++ b/drivers/gpio/gpio-da9052.c | |||
@@ -216,7 +216,7 @@ static int da9052_gpio_probe(struct platform_device *pdev) | |||
216 | return -ENOMEM; | 216 | return -ENOMEM; |
217 | 217 | ||
218 | gpio->da9052 = dev_get_drvdata(pdev->dev.parent); | 218 | gpio->da9052 = dev_get_drvdata(pdev->dev.parent); |
219 | pdata = gpio->da9052->dev->platform_data; | 219 | pdata = dev_get_platdata(gpio->da9052->dev); |
220 | 220 | ||
221 | gpio->gp = reference_gp; | 221 | gpio->gp = reference_gp; |
222 | if (pdata && pdata->gpio_base) | 222 | if (pdata && pdata->gpio_base) |
diff --git a/drivers/gpio/gpio-da9055.c b/drivers/gpio/gpio-da9055.c index fd6dfe382f13..7ef0820032bd 100644 --- a/drivers/gpio/gpio-da9055.c +++ b/drivers/gpio/gpio-da9055.c | |||
@@ -150,7 +150,7 @@ static int da9055_gpio_probe(struct platform_device *pdev) | |||
150 | return -ENOMEM; | 150 | return -ENOMEM; |
151 | 151 | ||
152 | gpio->da9055 = dev_get_drvdata(pdev->dev.parent); | 152 | gpio->da9055 = dev_get_drvdata(pdev->dev.parent); |
153 | pdata = gpio->da9055->dev->platform_data; | 153 | pdata = dev_get_platdata(gpio->da9055->dev); |
154 | 154 | ||
155 | gpio->gp = reference_gp; | 155 | gpio->gp = reference_gp; |
156 | if (pdata && pdata->gpio_base) | 156 | if (pdata && pdata->gpio_base) |
diff --git a/drivers/gpio/gpio-em.c b/drivers/gpio/gpio-em.c index eca119b58c21..c6e1f086efe8 100644 --- a/drivers/gpio/gpio-em.c +++ b/drivers/gpio/gpio-em.c | |||
@@ -253,7 +253,7 @@ static struct irq_domain_ops em_gio_irq_domain_ops = { | |||
253 | static int em_gio_probe(struct platform_device *pdev) | 253 | static int em_gio_probe(struct platform_device *pdev) |
254 | { | 254 | { |
255 | struct gpio_em_config pdata_dt; | 255 | struct gpio_em_config pdata_dt; |
256 | struct gpio_em_config *pdata = pdev->dev.platform_data; | 256 | struct gpio_em_config *pdata = dev_get_platdata(&pdev->dev); |
257 | struct em_gio_priv *p; | 257 | struct em_gio_priv *p; |
258 | struct resource *io[2], *irq[2]; | 258 | struct resource *io[2], *irq[2]; |
259 | struct gpio_chip *gpio_chip; | 259 | struct gpio_chip *gpio_chip; |
diff --git a/drivers/gpio/gpio-ich.c b/drivers/gpio/gpio-ich.c index 2729e3d2d5bb..814addb62d2c 100644 --- a/drivers/gpio/gpio-ich.c +++ b/drivers/gpio/gpio-ich.c | |||
@@ -354,7 +354,7 @@ static int ichx_gpio_probe(struct platform_device *pdev) | |||
354 | { | 354 | { |
355 | struct resource *res_base, *res_pm; | 355 | struct resource *res_base, *res_pm; |
356 | int err; | 356 | int err; |
357 | struct lpc_ich_info *ich_info = pdev->dev.platform_data; | 357 | struct lpc_ich_info *ich_info = dev_get_platdata(&pdev->dev); |
358 | 358 | ||
359 | if (!ich_info) | 359 | if (!ich_info) |
360 | return -ENODEV; | 360 | return -ENODEV; |
diff --git a/drivers/gpio/gpio-janz-ttl.c b/drivers/gpio/gpio-janz-ttl.c index 7d0a04169a35..2ecd3a09c743 100644 --- a/drivers/gpio/gpio-janz-ttl.c +++ b/drivers/gpio/gpio-janz-ttl.c | |||
@@ -149,7 +149,7 @@ static int ttl_probe(struct platform_device *pdev) | |||
149 | struct resource *res; | 149 | struct resource *res; |
150 | int ret; | 150 | int ret; |
151 | 151 | ||
152 | pdata = pdev->dev.platform_data; | 152 | pdata = dev_get_platdata(&pdev->dev); |
153 | if (!pdata) { | 153 | if (!pdata) { |
154 | dev_err(dev, "no platform data\n"); | 154 | dev_err(dev, "no platform data\n"); |
155 | ret = -ENXIO; | 155 | ret = -ENXIO; |
diff --git a/drivers/gpio/gpio-kempld.c b/drivers/gpio/gpio-kempld.c index 1bdc3a2e40dc..3f5b20038af1 100644 --- a/drivers/gpio/gpio-kempld.c +++ b/drivers/gpio/gpio-kempld.c | |||
@@ -150,7 +150,7 @@ static int kempld_gpio_probe(struct platform_device *pdev) | |||
150 | { | 150 | { |
151 | struct device *dev = &pdev->dev; | 151 | struct device *dev = &pdev->dev; |
152 | struct kempld_device_data *pld = dev_get_drvdata(dev->parent); | 152 | struct kempld_device_data *pld = dev_get_drvdata(dev->parent); |
153 | struct kempld_platform_data *pdata = pld->dev->platform_data; | 153 | struct kempld_platform_data *pdata = dev_get_platdata(pld->dev); |
154 | struct kempld_gpio_data *gpio; | 154 | struct kempld_gpio_data *gpio; |
155 | struct gpio_chip *chip; | 155 | struct gpio_chip *chip; |
156 | int ret; | 156 | int ret; |
diff --git a/drivers/gpio/gpio-max730x.c b/drivers/gpio/gpio-max730x.c index 00092342b84c..f4f4ed19bdc1 100644 --- a/drivers/gpio/gpio-max730x.c +++ b/drivers/gpio/gpio-max730x.c | |||
@@ -166,7 +166,7 @@ int __max730x_probe(struct max7301 *ts) | |||
166 | struct max7301_platform_data *pdata; | 166 | struct max7301_platform_data *pdata; |
167 | int i, ret; | 167 | int i, ret; |
168 | 168 | ||
169 | pdata = dev->platform_data; | 169 | pdata = dev_get_platdata(dev); |
170 | 170 | ||
171 | mutex_init(&ts->lock); | 171 | mutex_init(&ts->lock); |
172 | dev_set_drvdata(dev, ts); | 172 | dev_set_drvdata(dev, ts); |
diff --git a/drivers/gpio/gpio-max732x.c b/drivers/gpio/gpio-max732x.c index d4b51b163b03..91ad74dea8ce 100644 --- a/drivers/gpio/gpio-max732x.c +++ b/drivers/gpio/gpio-max732x.c | |||
@@ -453,7 +453,7 @@ static int max732x_irq_setup(struct max732x_chip *chip, | |||
453 | const struct i2c_device_id *id) | 453 | const struct i2c_device_id *id) |
454 | { | 454 | { |
455 | struct i2c_client *client = chip->client; | 455 | struct i2c_client *client = chip->client; |
456 | struct max732x_platform_data *pdata = client->dev.platform_data; | 456 | struct max732x_platform_data *pdata = dev_get_platdata(&client->dev); |
457 | int has_irq = max732x_features[id->driver_data] >> 32; | 457 | int has_irq = max732x_features[id->driver_data] >> 32; |
458 | int ret; | 458 | int ret; |
459 | 459 | ||
@@ -512,7 +512,7 @@ static int max732x_irq_setup(struct max732x_chip *chip, | |||
512 | const struct i2c_device_id *id) | 512 | const struct i2c_device_id *id) |
513 | { | 513 | { |
514 | struct i2c_client *client = chip->client; | 514 | struct i2c_client *client = chip->client; |
515 | struct max732x_platform_data *pdata = client->dev.platform_data; | 515 | struct max732x_platform_data *pdata = dev_get_platdata(&client->dev); |
516 | int has_irq = max732x_features[id->driver_data] >> 32; | 516 | int has_irq = max732x_features[id->driver_data] >> 32; |
517 | 517 | ||
518 | if (pdata->irq_base && has_irq != INT_NONE) | 518 | if (pdata->irq_base && has_irq != INT_NONE) |
@@ -583,7 +583,7 @@ static int max732x_probe(struct i2c_client *client, | |||
583 | uint16_t addr_a, addr_b; | 583 | uint16_t addr_a, addr_b; |
584 | int ret, nr_port; | 584 | int ret, nr_port; |
585 | 585 | ||
586 | pdata = client->dev.platform_data; | 586 | pdata = dev_get_platdata(&client->dev); |
587 | if (pdata == NULL) { | 587 | if (pdata == NULL) { |
588 | dev_dbg(&client->dev, "no platform data\n"); | 588 | dev_dbg(&client->dev, "no platform data\n"); |
589 | return -EINVAL; | 589 | return -EINVAL; |
@@ -653,7 +653,7 @@ out_failed: | |||
653 | 653 | ||
654 | static int max732x_remove(struct i2c_client *client) | 654 | static int max732x_remove(struct i2c_client *client) |
655 | { | 655 | { |
656 | struct max732x_platform_data *pdata = client->dev.platform_data; | 656 | struct max732x_platform_data *pdata = dev_get_platdata(&client->dev); |
657 | struct max732x_chip *chip = i2c_get_clientdata(client); | 657 | struct max732x_chip *chip = i2c_get_clientdata(client); |
658 | int ret; | 658 | int ret; |
659 | 659 | ||
diff --git a/drivers/gpio/gpio-mc33880.c b/drivers/gpio/gpio-mc33880.c index 63a7a1bfb2d9..3fd2caa4a2e0 100644 --- a/drivers/gpio/gpio-mc33880.c +++ b/drivers/gpio/gpio-mc33880.c | |||
@@ -86,7 +86,7 @@ static int mc33880_probe(struct spi_device *spi) | |||
86 | struct mc33880_platform_data *pdata; | 86 | struct mc33880_platform_data *pdata; |
87 | int ret; | 87 | int ret; |
88 | 88 | ||
89 | pdata = spi->dev.platform_data; | 89 | pdata = dev_get_platdata(&spi->dev); |
90 | if (!pdata || !pdata->base) { | 90 | if (!pdata || !pdata->base) { |
91 | dev_dbg(&spi->dev, "incorrect or missing platform data\n"); | 91 | dev_dbg(&spi->dev, "incorrect or missing platform data\n"); |
92 | return -EINVAL; | 92 | return -EINVAL; |
diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c index 87ed6bf6528b..d96bf8a76f5c 100644 --- a/drivers/gpio/gpio-mcp23s08.c +++ b/drivers/gpio/gpio-mcp23s08.c | |||
@@ -520,7 +520,7 @@ static int mcp230xx_probe(struct i2c_client *client, | |||
520 | 520 | ||
521 | match = of_match_device(of_match_ptr(mcp23s08_i2c_of_match), | 521 | match = of_match_device(of_match_ptr(mcp23s08_i2c_of_match), |
522 | &client->dev); | 522 | &client->dev); |
523 | pdata = client->dev.platform_data; | 523 | pdata = dev_get_platdata(&client->dev); |
524 | if (match || !pdata) { | 524 | if (match || !pdata) { |
525 | base = -1; | 525 | base = -1; |
526 | pullups = 0; | 526 | pullups = 0; |
@@ -634,7 +634,7 @@ static int mcp23s08_probe(struct spi_device *spi) | |||
634 | pullups[addr] = 0; | 634 | pullups[addr] = 0; |
635 | } else { | 635 | } else { |
636 | type = spi_get_device_id(spi)->driver_data; | 636 | type = spi_get_device_id(spi)->driver_data; |
637 | pdata = spi->dev.platform_data; | 637 | pdata = dev_get_platdata(&spi->dev); |
638 | if (!pdata || !gpio_is_valid(pdata->base)) { | 638 | if (!pdata || !gpio_is_valid(pdata->base)) { |
639 | dev_dbg(&spi->dev, | 639 | dev_dbg(&spi->dev, |
640 | "invalid or missing platform data\n"); | 640 | "invalid or missing platform data\n"); |
diff --git a/drivers/gpio/gpio-msic.c b/drivers/gpio/gpio-msic.c index 27ea7b9257ff..d75eaa3a1dcc 100644 --- a/drivers/gpio/gpio-msic.c +++ b/drivers/gpio/gpio-msic.c | |||
@@ -259,7 +259,7 @@ static void msic_gpio_irq_handler(unsigned irq, struct irq_desc *desc) | |||
259 | static int platform_msic_gpio_probe(struct platform_device *pdev) | 259 | static int platform_msic_gpio_probe(struct platform_device *pdev) |
260 | { | 260 | { |
261 | struct device *dev = &pdev->dev; | 261 | struct device *dev = &pdev->dev; |
262 | struct intel_msic_gpio_pdata *pdata = dev->platform_data; | 262 | struct intel_msic_gpio_pdata *pdata = dev_get_platdata(dev); |
263 | struct msic_gpio *mg; | 263 | struct msic_gpio *mg; |
264 | int irq = platform_get_irq(pdev, 0); | 264 | int irq = platform_get_irq(pdev, 0); |
265 | int retval; | 265 | int retval; |
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index dfeb3a3a8f20..867efe57b038 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c | |||
@@ -1100,7 +1100,7 @@ static int omap_gpio_probe(struct platform_device *pdev) | |||
1100 | 1100 | ||
1101 | match = of_match_device(of_match_ptr(omap_gpio_match), dev); | 1101 | match = of_match_device(of_match_ptr(omap_gpio_match), dev); |
1102 | 1102 | ||
1103 | pdata = match ? match->data : dev->platform_data; | 1103 | pdata = match ? match->data : dev_get_platdata(dev); |
1104 | if (!pdata) | 1104 | if (!pdata) |
1105 | return -EINVAL; | 1105 | return -EINVAL; |
1106 | 1106 | ||
diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c index 426c51dd420c..07651d30ba8b 100644 --- a/drivers/gpio/gpio-pca953x.c +++ b/drivers/gpio/gpio-pca953x.c | |||
@@ -731,7 +731,7 @@ static int pca953x_probe(struct i2c_client *client, | |||
731 | if (chip == NULL) | 731 | if (chip == NULL) |
732 | return -ENOMEM; | 732 | return -ENOMEM; |
733 | 733 | ||
734 | pdata = client->dev.platform_data; | 734 | pdata = dev_get_platdata(&client->dev); |
735 | if (pdata) { | 735 | if (pdata) { |
736 | irq_base = pdata->irq_base; | 736 | irq_base = pdata->irq_base; |
737 | chip->gpio_start = pdata->gpio_base; | 737 | chip->gpio_start = pdata->gpio_base; |
@@ -785,7 +785,7 @@ static int pca953x_probe(struct i2c_client *client, | |||
785 | 785 | ||
786 | static int pca953x_remove(struct i2c_client *client) | 786 | static int pca953x_remove(struct i2c_client *client) |
787 | { | 787 | { |
788 | struct pca953x_platform_data *pdata = client->dev.platform_data; | 788 | struct pca953x_platform_data *pdata = dev_get_platdata(&client->dev); |
789 | struct pca953x_chip *chip = i2c_get_clientdata(client); | 789 | struct pca953x_chip *chip = i2c_get_clientdata(client); |
790 | int ret = 0; | 790 | int ret = 0; |
791 | 791 | ||
diff --git a/drivers/gpio/gpio-pcf857x.c b/drivers/gpio/gpio-pcf857x.c index e8faf53f3875..e8835d64e921 100644 --- a/drivers/gpio/gpio-pcf857x.c +++ b/drivers/gpio/gpio-pcf857x.c | |||
@@ -262,7 +262,7 @@ static int pcf857x_probe(struct i2c_client *client, | |||
262 | struct pcf857x *gpio; | 262 | struct pcf857x *gpio; |
263 | int status; | 263 | int status; |
264 | 264 | ||
265 | pdata = client->dev.platform_data; | 265 | pdata = dev_get_platdata(&client->dev); |
266 | if (!pdata) { | 266 | if (!pdata) { |
267 | dev_dbg(&client->dev, "no platform data\n"); | 267 | dev_dbg(&client->dev, "no platform data\n"); |
268 | } | 268 | } |
@@ -396,7 +396,7 @@ fail: | |||
396 | 396 | ||
397 | static int pcf857x_remove(struct i2c_client *client) | 397 | static int pcf857x_remove(struct i2c_client *client) |
398 | { | 398 | { |
399 | struct pcf857x_platform_data *pdata = client->dev.platform_data; | 399 | struct pcf857x_platform_data *pdata = dev_get_platdata(&client->dev); |
400 | struct pcf857x *gpio = i2c_get_clientdata(client); | 400 | struct pcf857x *gpio = i2c_get_clientdata(client); |
401 | int status = 0; | 401 | int status = 0; |
402 | 402 | ||
diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index 6a4bd0dae0ce..4274e2e70ef8 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c | |||
@@ -259,7 +259,7 @@ static const struct irq_domain_ops pl061_domain_ops = { | |||
259 | static int pl061_probe(struct amba_device *adev, const struct amba_id *id) | 259 | static int pl061_probe(struct amba_device *adev, const struct amba_id *id) |
260 | { | 260 | { |
261 | struct device *dev = &adev->dev; | 261 | struct device *dev = &adev->dev; |
262 | struct pl061_platform_data *pdata = dev->platform_data; | 262 | struct pl061_platform_data *pdata = dev_get_platdata(dev); |
263 | struct pl061_gpio *chip; | 263 | struct pl061_gpio *chip; |
264 | int ret, irq, i, irq_base; | 264 | int ret, irq, i, irq_base; |
265 | 265 | ||
diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index e8198dd68615..e3745eb07570 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c | |||
@@ -285,7 +285,7 @@ static struct irq_domain_ops gpio_rcar_irq_domain_ops = { | |||
285 | 285 | ||
286 | static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p) | 286 | static void gpio_rcar_parse_pdata(struct gpio_rcar_priv *p) |
287 | { | 287 | { |
288 | struct gpio_rcar_config *pdata = p->pdev->dev.platform_data; | 288 | struct gpio_rcar_config *pdata = dev_get_platdata(&p->pdev->dev); |
289 | struct device_node *np = p->pdev->dev.of_node; | 289 | struct device_node *np = p->pdev->dev.of_node; |
290 | struct of_phandle_args args; | 290 | struct of_phandle_args args; |
291 | int ret; | 291 | int ret; |
diff --git a/drivers/gpio/gpio-rdc321x.c b/drivers/gpio/gpio-rdc321x.c index 368c3c00fca5..88577c3272a5 100644 --- a/drivers/gpio/gpio-rdc321x.c +++ b/drivers/gpio/gpio-rdc321x.c | |||
@@ -135,7 +135,7 @@ static int rdc321x_gpio_probe(struct platform_device *pdev) | |||
135 | struct rdc321x_gpio *rdc321x_gpio_dev; | 135 | struct rdc321x_gpio *rdc321x_gpio_dev; |
136 | struct rdc321x_gpio_pdata *pdata; | 136 | struct rdc321x_gpio_pdata *pdata; |
137 | 137 | ||
138 | pdata = pdev->dev.platform_data; | 138 | pdata = dev_get_platdata(&pdev->dev); |
139 | if (!pdata) { | 139 | if (!pdata) { |
140 | dev_err(&pdev->dev, "no platform data supplied\n"); | 140 | dev_err(&pdev->dev, "no platform data supplied\n"); |
141 | return -ENODEV; | 141 | return -ENODEV; |
diff --git a/drivers/gpio/gpio-sta2x11.c b/drivers/gpio/gpio-sta2x11.c index f43ab6aea281..f2fb12c18da9 100644 --- a/drivers/gpio/gpio-sta2x11.c +++ b/drivers/gpio/gpio-sta2x11.c | |||
@@ -361,7 +361,7 @@ static int gsta_probe(struct platform_device *dev) | |||
361 | struct gsta_gpio *chip; | 361 | struct gsta_gpio *chip; |
362 | struct resource *res; | 362 | struct resource *res; |
363 | 363 | ||
364 | pdev = *(struct pci_dev **)(dev->dev.platform_data); | 364 | pdev = *(struct pci_dev **)dev_get_platdata(&dev->dev); |
365 | gpio_pdata = dev_get_platdata(&pdev->dev); | 365 | gpio_pdata = dev_get_platdata(&pdev->dev); |
366 | 366 | ||
367 | if (gpio_pdata == NULL) | 367 | if (gpio_pdata == NULL) |
diff --git a/drivers/gpio/gpio-sx150x.c b/drivers/gpio/gpio-sx150x.c index f371732591d2..d2983e9ad6af 100644 --- a/drivers/gpio/gpio-sx150x.c +++ b/drivers/gpio/gpio-sx150x.c | |||
@@ -583,7 +583,7 @@ static int sx150x_probe(struct i2c_client *client, | |||
583 | struct sx150x_chip *chip; | 583 | struct sx150x_chip *chip; |
584 | int rc; | 584 | int rc; |
585 | 585 | ||
586 | pdata = client->dev.platform_data; | 586 | pdata = dev_get_platdata(&client->dev); |
587 | if (!pdata) | 587 | if (!pdata) |
588 | return -EINVAL; | 588 | return -EINVAL; |
589 | 589 | ||
diff --git a/drivers/gpio/gpio-timberdale.c b/drivers/gpio/gpio-timberdale.c index 4c65f8883204..7a0e956ef1ed 100644 --- a/drivers/gpio/gpio-timberdale.c +++ b/drivers/gpio/gpio-timberdale.c | |||
@@ -227,7 +227,7 @@ static int timbgpio_probe(struct platform_device *pdev) | |||
227 | struct gpio_chip *gc; | 227 | struct gpio_chip *gc; |
228 | struct timbgpio *tgpio; | 228 | struct timbgpio *tgpio; |
229 | struct resource *iomem; | 229 | struct resource *iomem; |
230 | struct timbgpio_platform_data *pdata = pdev->dev.platform_data; | 230 | struct timbgpio_platform_data *pdata = dev_get_platdata(&pdev->dev); |
231 | int irq = platform_get_irq(pdev, 0); | 231 | int irq = platform_get_irq(pdev, 0); |
232 | 232 | ||
233 | if (!pdata || pdata->nr_pins > 32) { | 233 | if (!pdata || pdata->nr_pins > 32) { |
@@ -318,7 +318,7 @@ err_mem: | |||
318 | static int timbgpio_remove(struct platform_device *pdev) | 318 | static int timbgpio_remove(struct platform_device *pdev) |
319 | { | 319 | { |
320 | int err; | 320 | int err; |
321 | struct timbgpio_platform_data *pdata = pdev->dev.platform_data; | 321 | struct timbgpio_platform_data *pdata = dev_get_platdata(&pdev->dev); |
322 | struct timbgpio *tgpio = platform_get_drvdata(pdev); | 322 | struct timbgpio *tgpio = platform_get_drvdata(pdev); |
323 | struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 323 | struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
324 | int irq = platform_get_irq(pdev, 0); | 324 | int irq = platform_get_irq(pdev, 0); |
diff --git a/drivers/gpio/gpio-tps65912.c b/drivers/gpio/gpio-tps65912.c index 30a5844a7dca..276a4229b032 100644 --- a/drivers/gpio/gpio-tps65912.c +++ b/drivers/gpio/gpio-tps65912.c | |||
@@ -87,7 +87,7 @@ static struct gpio_chip template_chip = { | |||
87 | static int tps65912_gpio_probe(struct platform_device *pdev) | 87 | static int tps65912_gpio_probe(struct platform_device *pdev) |
88 | { | 88 | { |
89 | struct tps65912 *tps65912 = dev_get_drvdata(pdev->dev.parent); | 89 | struct tps65912 *tps65912 = dev_get_drvdata(pdev->dev.parent); |
90 | struct tps65912_board *pdata = tps65912->dev->platform_data; | 90 | struct tps65912_board *pdata = dev_get_platdata(tps65912->dev); |
91 | struct tps65912_gpio_data *tps65912_gpio; | 91 | struct tps65912_gpio_data *tps65912_gpio; |
92 | int ret; | 92 | int ret; |
93 | 93 | ||
diff --git a/drivers/gpio/gpio-ts5500.c b/drivers/gpio/gpio-ts5500.c index cc53cab8df2a..3df3ebdb3e52 100644 --- a/drivers/gpio/gpio-ts5500.c +++ b/drivers/gpio/gpio-ts5500.c | |||
@@ -322,7 +322,7 @@ static void ts5500_disable_irq(struct ts5500_priv *priv) | |||
322 | static int ts5500_dio_probe(struct platform_device *pdev) | 322 | static int ts5500_dio_probe(struct platform_device *pdev) |
323 | { | 323 | { |
324 | enum ts5500_blocks block = platform_get_device_id(pdev)->driver_data; | 324 | enum ts5500_blocks block = platform_get_device_id(pdev)->driver_data; |
325 | struct ts5500_dio_platform_data *pdata = pdev->dev.platform_data; | 325 | struct ts5500_dio_platform_data *pdata = dev_get_platdata(&pdev->dev); |
326 | struct device *dev = &pdev->dev; | 326 | struct device *dev = &pdev->dev; |
327 | const char *name = dev_name(dev); | 327 | const char *name = dev_name(dev); |
328 | struct ts5500_priv *priv; | 328 | struct ts5500_priv *priv; |
diff --git a/drivers/gpio/gpio-twl4030.c b/drivers/gpio/gpio-twl4030.c index 4d330e36da1d..d8e4f6efcb29 100644 --- a/drivers/gpio/gpio-twl4030.c +++ b/drivers/gpio/gpio-twl4030.c | |||
@@ -256,7 +256,7 @@ static int twl_request(struct gpio_chip *chip, unsigned offset) | |||
256 | /* optionally have the first two GPIOs switch vMMC1 | 256 | /* optionally have the first two GPIOs switch vMMC1 |
257 | * and vMMC2 power supplies based on card presence. | 257 | * and vMMC2 power supplies based on card presence. |
258 | */ | 258 | */ |
259 | pdata = chip->dev->platform_data; | 259 | pdata = dev_get_platdata(chip->dev); |
260 | if (pdata) | 260 | if (pdata) |
261 | value |= pdata->mmc_cd & 0x03; | 261 | value |= pdata->mmc_cd & 0x03; |
262 | 262 | ||
@@ -460,7 +460,7 @@ static struct twl4030_gpio_platform_data *of_gpio_twl4030(struct device *dev) | |||
460 | 460 | ||
461 | static int gpio_twl4030_probe(struct platform_device *pdev) | 461 | static int gpio_twl4030_probe(struct platform_device *pdev) |
462 | { | 462 | { |
463 | struct twl4030_gpio_platform_data *pdata = pdev->dev.platform_data; | 463 | struct twl4030_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev); |
464 | struct device_node *node = pdev->dev.of_node; | 464 | struct device_node *node = pdev->dev.of_node; |
465 | struct gpio_twl4030_priv *priv; | 465 | struct gpio_twl4030_priv *priv; |
466 | int ret, irq_base; | 466 | int ret, irq_base; |
@@ -556,7 +556,7 @@ out: | |||
556 | /* Cannot use as gpio_twl4030_probe() calls us */ | 556 | /* Cannot use as gpio_twl4030_probe() calls us */ |
557 | static int gpio_twl4030_remove(struct platform_device *pdev) | 557 | static int gpio_twl4030_remove(struct platform_device *pdev) |
558 | { | 558 | { |
559 | struct twl4030_gpio_platform_data *pdata = pdev->dev.platform_data; | 559 | struct twl4030_gpio_platform_data *pdata = dev_get_platdata(&pdev->dev); |
560 | struct gpio_twl4030_priv *priv = platform_get_drvdata(pdev); | 560 | struct gpio_twl4030_priv *priv = platform_get_drvdata(pdev); |
561 | int status; | 561 | int status; |
562 | 562 | ||
diff --git a/drivers/gpio/gpio-ucb1400.c b/drivers/gpio/gpio-ucb1400.c index 6d0feb234d3c..1a605f2a0f55 100644 --- a/drivers/gpio/gpio-ucb1400.c +++ b/drivers/gpio/gpio-ucb1400.c | |||
@@ -45,7 +45,7 @@ static void ucb1400_gpio_set(struct gpio_chip *gc, unsigned off, int val) | |||
45 | 45 | ||
46 | static int ucb1400_gpio_probe(struct platform_device *dev) | 46 | static int ucb1400_gpio_probe(struct platform_device *dev) |
47 | { | 47 | { |
48 | struct ucb1400_gpio *ucb = dev->dev.platform_data; | 48 | struct ucb1400_gpio *ucb = dev_get_platdata(&dev->dev); |
49 | int err = 0; | 49 | int err = 0; |
50 | 50 | ||
51 | if (!(ucb && ucb->gpio_offset)) { | 51 | if (!(ucb && ucb->gpio_offset)) { |
diff --git a/drivers/gpio/gpio-wm831x.c b/drivers/gpio/gpio-wm831x.c index 2a743e10ecb6..456000c5c457 100644 --- a/drivers/gpio/gpio-wm831x.c +++ b/drivers/gpio/gpio-wm831x.c | |||
@@ -246,7 +246,7 @@ static struct gpio_chip template_chip = { | |||
246 | static int wm831x_gpio_probe(struct platform_device *pdev) | 246 | static int wm831x_gpio_probe(struct platform_device *pdev) |
247 | { | 247 | { |
248 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); | 248 | struct wm831x *wm831x = dev_get_drvdata(pdev->dev.parent); |
249 | struct wm831x_pdata *pdata = wm831x->dev->platform_data; | 249 | struct wm831x_pdata *pdata = dev_get_platdata(wm831x->dev); |
250 | struct wm831x_gpio *wm831x_gpio; | 250 | struct wm831x_gpio *wm831x_gpio; |
251 | int ret; | 251 | int ret; |
252 | 252 | ||
diff --git a/drivers/gpio/gpio-wm8350.c b/drivers/gpio/gpio-wm8350.c index 0b598cf3df9d..fc49154be7b1 100644 --- a/drivers/gpio/gpio-wm8350.c +++ b/drivers/gpio/gpio-wm8350.c | |||
@@ -112,7 +112,7 @@ static struct gpio_chip template_chip = { | |||
112 | static int wm8350_gpio_probe(struct platform_device *pdev) | 112 | static int wm8350_gpio_probe(struct platform_device *pdev) |
113 | { | 113 | { |
114 | struct wm8350 *wm8350 = dev_get_drvdata(pdev->dev.parent); | 114 | struct wm8350 *wm8350 = dev_get_drvdata(pdev->dev.parent); |
115 | struct wm8350_platform_data *pdata = wm8350->dev->platform_data; | 115 | struct wm8350_platform_data *pdata = dev_get_platdata(wm8350->dev); |
116 | struct wm8350_gpio_data *wm8350_gpio; | 116 | struct wm8350_gpio_data *wm8350_gpio; |
117 | int ret; | 117 | int ret; |
118 | 118 | ||
diff --git a/drivers/gpio/gpio-wm8994.c b/drivers/gpio/gpio-wm8994.c index ae409fd94af7..a53dbdefc7ee 100644 --- a/drivers/gpio/gpio-wm8994.c +++ b/drivers/gpio/gpio-wm8994.c | |||
@@ -248,7 +248,7 @@ static struct gpio_chip template_chip = { | |||
248 | static int wm8994_gpio_probe(struct platform_device *pdev) | 248 | static int wm8994_gpio_probe(struct platform_device *pdev) |
249 | { | 249 | { |
250 | struct wm8994 *wm8994 = dev_get_drvdata(pdev->dev.parent); | 250 | struct wm8994 *wm8994 = dev_get_drvdata(pdev->dev.parent); |
251 | struct wm8994_pdata *pdata = wm8994->dev->platform_data; | 251 | struct wm8994_pdata *pdata = dev_get_platdata(wm8994->dev); |
252 | struct wm8994_gpio *wm8994_gpio; | 252 | struct wm8994_gpio *wm8994_gpio; |
253 | int ret; | 253 | int ret; |
254 | 254 | ||