diff options
25 files changed, 40 insertions, 35 deletions
diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c index 37d423964c46..35a473ba3d81 100644 --- a/drivers/i2c/busses/i2c-bfin-twi.c +++ b/drivers/i2c/busses/i2c-bfin-twi.c | |||
@@ -674,8 +674,9 @@ static int i2c_bfin_twi_probe(struct platform_device *pdev) | |||
674 | p_adap->timeout = 5 * HZ; | 674 | p_adap->timeout = 5 * HZ; |
675 | p_adap->retries = 3; | 675 | p_adap->retries = 3; |
676 | 676 | ||
677 | rc = peripheral_request_list((unsigned short *)pdev->dev.platform_data, | 677 | rc = peripheral_request_list( |
678 | "i2c-bfin-twi"); | 678 | (unsigned short *)dev_get_platdata(&pdev->dev), |
679 | "i2c-bfin-twi"); | ||
679 | if (rc) { | 680 | if (rc) { |
680 | dev_err(&pdev->dev, "Can't setup pin mux!\n"); | 681 | dev_err(&pdev->dev, "Can't setup pin mux!\n"); |
681 | goto out_error_pin_mux; | 682 | goto out_error_pin_mux; |
@@ -722,7 +723,7 @@ out_error_add_adapter: | |||
722 | free_irq(iface->irq, iface); | 723 | free_irq(iface->irq, iface); |
723 | out_error_req_irq: | 724 | out_error_req_irq: |
724 | out_error_no_irq: | 725 | out_error_no_irq: |
725 | peripheral_free_list((unsigned short *)pdev->dev.platform_data); | 726 | peripheral_free_list((unsigned short *)dev_get_platdata(&pdev->dev)); |
726 | out_error_pin_mux: | 727 | out_error_pin_mux: |
727 | iounmap(iface->regs_base); | 728 | iounmap(iface->regs_base); |
728 | out_error_ioremap: | 729 | out_error_ioremap: |
@@ -738,7 +739,7 @@ static int i2c_bfin_twi_remove(struct platform_device *pdev) | |||
738 | 739 | ||
739 | i2c_del_adapter(&(iface->adap)); | 740 | i2c_del_adapter(&(iface->adap)); |
740 | free_irq(iface->irq, iface); | 741 | free_irq(iface->irq, iface); |
741 | peripheral_free_list((unsigned short *)pdev->dev.platform_data); | 742 | peripheral_free_list((unsigned short *)dev_get_platdata(&pdev->dev)); |
742 | iounmap(iface->regs_base); | 743 | iounmap(iface->regs_base); |
743 | kfree(iface); | 744 | kfree(iface); |
744 | 745 | ||
diff --git a/drivers/i2c/busses/i2c-cbus-gpio.c b/drivers/i2c/busses/i2c-cbus-gpio.c index 1be13ac11dc5..2d46f13adfdf 100644 --- a/drivers/i2c/busses/i2c-cbus-gpio.c +++ b/drivers/i2c/busses/i2c-cbus-gpio.c | |||
@@ -233,8 +233,9 @@ static int cbus_i2c_probe(struct platform_device *pdev) | |||
233 | chost->clk_gpio = of_get_gpio(dnode, 0); | 233 | chost->clk_gpio = of_get_gpio(dnode, 0); |
234 | chost->dat_gpio = of_get_gpio(dnode, 1); | 234 | chost->dat_gpio = of_get_gpio(dnode, 1); |
235 | chost->sel_gpio = of_get_gpio(dnode, 2); | 235 | chost->sel_gpio = of_get_gpio(dnode, 2); |
236 | } else if (pdev->dev.platform_data) { | 236 | } else if (dev_get_platdata(&pdev->dev)) { |
237 | struct i2c_cbus_platform_data *pdata = pdev->dev.platform_data; | 237 | struct i2c_cbus_platform_data *pdata = |
238 | dev_get_platdata(&pdev->dev); | ||
238 | chost->clk_gpio = pdata->clk_gpio; | 239 | chost->clk_gpio = pdata->clk_gpio; |
239 | chost->dat_gpio = pdata->dat_gpio; | 240 | chost->dat_gpio = pdata->dat_gpio; |
240 | chost->sel_gpio = pdata->sel_gpio; | 241 | chost->sel_gpio = pdata->sel_gpio; |
diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index 5898df30e798..cf90bfff9676 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c | |||
@@ -663,7 +663,7 @@ static int davinci_i2c_probe(struct platform_device *pdev) | |||
663 | #endif | 663 | #endif |
664 | dev->dev = &pdev->dev; | 664 | dev->dev = &pdev->dev; |
665 | dev->irq = irq->start; | 665 | dev->irq = irq->start; |
666 | dev->pdata = dev->dev->platform_data; | 666 | dev->pdata = dev_get_platdata(&dev->dev); |
667 | platform_set_drvdata(pdev, dev); | 667 | platform_set_drvdata(pdev, dev); |
668 | 668 | ||
669 | if (!dev->pdata && pdev->dev.of_node) { | 669 | if (!dev->pdata && pdev->dev.of_node) { |
diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c index bc6e139c6e7f..8cdb4f743e19 100644 --- a/drivers/i2c/busses/i2c-gpio.c +++ b/drivers/i2c/busses/i2c-gpio.c | |||
@@ -137,9 +137,9 @@ static int i2c_gpio_probe(struct platform_device *pdev) | |||
137 | if (ret) | 137 | if (ret) |
138 | return ret; | 138 | return ret; |
139 | } else { | 139 | } else { |
140 | if (!pdev->dev.platform_data) | 140 | if (!dev_get_platdata(&pdev->dev)) |
141 | return -ENXIO; | 141 | return -ENXIO; |
142 | pdata = pdev->dev.platform_data; | 142 | pdata = dev_get_platdata(&pdev->dev); |
143 | sda_pin = pdata->sda_pin; | 143 | sda_pin = pdata->sda_pin; |
144 | scl_pin = pdata->scl_pin; | 144 | scl_pin = pdata->scl_pin; |
145 | } | 145 | } |
@@ -171,7 +171,7 @@ static int i2c_gpio_probe(struct platform_device *pdev) | |||
171 | pdata->scl_pin = scl_pin; | 171 | pdata->scl_pin = scl_pin; |
172 | of_i2c_gpio_get_props(pdev->dev.of_node, pdata); | 172 | of_i2c_gpio_get_props(pdev->dev.of_node, pdata); |
173 | } else { | 173 | } else { |
174 | memcpy(pdata, pdev->dev.platform_data, sizeof(*pdata)); | 174 | memcpy(pdata, dev_get_platdata(&pdev->dev), sizeof(*pdata)); |
175 | } | 175 | } |
176 | 176 | ||
177 | if (pdata->sda_is_open_drain) { | 177 | if (pdata->sda_is_open_drain) { |
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 9c0f8bda692a..a231d2fd91ce 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c | |||
@@ -596,7 +596,7 @@ static int __init i2c_imx_probe(struct platform_device *pdev) | |||
596 | &pdev->dev); | 596 | &pdev->dev); |
597 | struct imx_i2c_struct *i2c_imx; | 597 | struct imx_i2c_struct *i2c_imx; |
598 | struct resource *res; | 598 | struct resource *res; |
599 | struct imxi2c_platform_data *pdata = pdev->dev.platform_data; | 599 | struct imxi2c_platform_data *pdata = dev_get_platdata(&pdev->dev); |
600 | void __iomem *base; | 600 | void __iomem *base; |
601 | int irq, ret; | 601 | int irq, ret; |
602 | u32 bitrate; | 602 | u32 bitrate; |
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c index b1f42bf40963..9cc361d19941 100644 --- a/drivers/i2c/busses/i2c-mv64xxx.c +++ b/drivers/i2c/busses/i2c-mv64xxx.c | |||
@@ -618,7 +618,7 @@ static int | |||
618 | mv64xxx_i2c_probe(struct platform_device *pd) | 618 | mv64xxx_i2c_probe(struct platform_device *pd) |
619 | { | 619 | { |
620 | struct mv64xxx_i2c_data *drv_data; | 620 | struct mv64xxx_i2c_data *drv_data; |
621 | struct mv64xxx_i2c_pdata *pdata = pd->dev.platform_data; | 621 | struct mv64xxx_i2c_pdata *pdata = dev_get_platdata(&pd->dev); |
622 | struct resource *r; | 622 | struct resource *r; |
623 | int rc; | 623 | int rc; |
624 | 624 | ||
diff --git a/drivers/i2c/busses/i2c-nomadik.c b/drivers/i2c/busses/i2c-nomadik.c index 512dfe609706..1909e8073541 100644 --- a/drivers/i2c/busses/i2c-nomadik.c +++ b/drivers/i2c/busses/i2c-nomadik.c | |||
@@ -943,7 +943,7 @@ static void nmk_i2c_of_probe(struct device_node *np, | |||
943 | static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id) | 943 | static int nmk_i2c_probe(struct amba_device *adev, const struct amba_id *id) |
944 | { | 944 | { |
945 | int ret = 0; | 945 | int ret = 0; |
946 | struct nmk_i2c_controller *pdata = adev->dev.platform_data; | 946 | struct nmk_i2c_controller *pdata = dev_get_platdata(&adev->dev); |
947 | struct device_node *np = adev->dev.of_node; | 947 | struct device_node *np = adev->dev.of_node; |
948 | struct nmk_i2c_dev *dev; | 948 | struct nmk_i2c_dev *dev; |
949 | struct i2c_adapter *adap; | 949 | struct i2c_adapter *adap; |
diff --git a/drivers/i2c/busses/i2c-nuc900.c b/drivers/i2c/busses/i2c-nuc900.c index 865ee350adb3..36394d737faf 100644 --- a/drivers/i2c/busses/i2c-nuc900.c +++ b/drivers/i2c/busses/i2c-nuc900.c | |||
@@ -525,7 +525,7 @@ static int nuc900_i2c_probe(struct platform_device *pdev) | |||
525 | struct resource *res; | 525 | struct resource *res; |
526 | int ret; | 526 | int ret; |
527 | 527 | ||
528 | pdata = pdev->dev.platform_data; | 528 | pdata = dev_get_platdata(&pdev->dev); |
529 | if (!pdata) { | 529 | if (!pdata) { |
530 | dev_err(&pdev->dev, "no platform data\n"); | 530 | dev_err(&pdev->dev, "no platform data\n"); |
531 | return -EINVAL; | 531 | return -EINVAL; |
diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c index 7ac8b9cc9184..e14182cd87ff 100644 --- a/drivers/i2c/busses/i2c-ocores.c +++ b/drivers/i2c/busses/i2c-ocores.c | |||
@@ -366,7 +366,7 @@ static int ocores_i2c_probe(struct platform_device *pdev) | |||
366 | if (IS_ERR(i2c->base)) | 366 | if (IS_ERR(i2c->base)) |
367 | return PTR_ERR(i2c->base); | 367 | return PTR_ERR(i2c->base); |
368 | 368 | ||
369 | pdata = pdev->dev.platform_data; | 369 | pdata = dev_get_platdata(&pdev->dev); |
370 | if (pdata) { | 370 | if (pdata) { |
371 | i2c->reg_shift = pdata->reg_shift; | 371 | i2c->reg_shift = pdata->reg_shift; |
372 | i2c->reg_io_width = pdata->reg_io_width; | 372 | i2c->reg_io_width = pdata->reg_io_width; |
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index c6db76ec5a22..9ccb7b9cb6fc 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c | |||
@@ -1075,7 +1075,7 @@ omap_i2c_probe(struct platform_device *pdev) | |||
1075 | struct i2c_adapter *adap; | 1075 | struct i2c_adapter *adap; |
1076 | struct resource *mem; | 1076 | struct resource *mem; |
1077 | const struct omap_i2c_bus_platform_data *pdata = | 1077 | const struct omap_i2c_bus_platform_data *pdata = |
1078 | pdev->dev.platform_data; | 1078 | dev_get_platdata(&pdev->dev); |
1079 | struct device_node *node = pdev->dev.of_node; | 1079 | struct device_node *node = pdev->dev.of_node; |
1080 | const struct of_device_id *match; | 1080 | const struct of_device_id *match; |
1081 | int irq; | 1081 | int irq; |
diff --git a/drivers/i2c/busses/i2c-pca-platform.c b/drivers/i2c/busses/i2c-pca-platform.c index aa00df14e30b..39e2755e3f25 100644 --- a/drivers/i2c/busses/i2c-pca-platform.c +++ b/drivers/i2c/busses/i2c-pca-platform.c | |||
@@ -136,7 +136,7 @@ static int i2c_pca_pf_probe(struct platform_device *pdev) | |||
136 | struct i2c_pca_pf_data *i2c; | 136 | struct i2c_pca_pf_data *i2c; |
137 | struct resource *res; | 137 | struct resource *res; |
138 | struct i2c_pca9564_pf_platform_data *platform_data = | 138 | struct i2c_pca9564_pf_platform_data *platform_data = |
139 | pdev->dev.platform_data; | 139 | dev_get_platdata(&pdev->dev); |
140 | int ret = 0; | 140 | int ret = 0; |
141 | int irq; | 141 | int irq; |
142 | 142 | ||
diff --git a/drivers/i2c/busses/i2c-powermac.c b/drivers/i2c/busses/i2c-powermac.c index 8dc90da1e6e6..5a88364a542b 100644 --- a/drivers/i2c/busses/i2c-powermac.c +++ b/drivers/i2c/busses/i2c-powermac.c | |||
@@ -398,7 +398,7 @@ static void i2c_powermac_register_devices(struct i2c_adapter *adap, | |||
398 | 398 | ||
399 | static int i2c_powermac_probe(struct platform_device *dev) | 399 | static int i2c_powermac_probe(struct platform_device *dev) |
400 | { | 400 | { |
401 | struct pmac_i2c_bus *bus = dev->dev.platform_data; | 401 | struct pmac_i2c_bus *bus = dev_get_platdata(&dev->dev); |
402 | struct device_node *parent = NULL; | 402 | struct device_node *parent = NULL; |
403 | struct i2c_adapter *adapter; | 403 | struct i2c_adapter *adapter; |
404 | const char *basename; | 404 | const char *basename; |
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index a61d9062bf7b..3dbc1acdc28a 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c | |||
@@ -1118,7 +1118,7 @@ static int i2c_pxa_probe_pdata(struct platform_device *pdev, | |||
1118 | struct pxa_i2c *i2c, | 1118 | struct pxa_i2c *i2c, |
1119 | enum pxa_i2c_types *i2c_types) | 1119 | enum pxa_i2c_types *i2c_types) |
1120 | { | 1120 | { |
1121 | struct i2c_pxa_platform_data *plat = pdev->dev.platform_data; | 1121 | struct i2c_pxa_platform_data *plat = dev_get_platdata(&pdev->dev); |
1122 | const struct platform_device_id *id = platform_get_device_id(pdev); | 1122 | const struct platform_device_id *id = platform_get_device_id(pdev); |
1123 | 1123 | ||
1124 | *i2c_types = id->driver_data; | 1124 | *i2c_types = id->driver_data; |
@@ -1136,7 +1136,7 @@ static int i2c_pxa_probe_pdata(struct platform_device *pdev, | |||
1136 | 1136 | ||
1137 | static int i2c_pxa_probe(struct platform_device *dev) | 1137 | static int i2c_pxa_probe(struct platform_device *dev) |
1138 | { | 1138 | { |
1139 | struct i2c_pxa_platform_data *plat = dev->dev.platform_data; | 1139 | struct i2c_pxa_platform_data *plat = dev_get_platdata(&dev->dev); |
1140 | enum pxa_i2c_types i2c_type; | 1140 | enum pxa_i2c_types i2c_type; |
1141 | struct pxa_i2c *i2c; | 1141 | struct pxa_i2c *i2c; |
1142 | struct resource *res = NULL; | 1142 | struct resource *res = NULL; |
diff --git a/drivers/i2c/busses/i2c-rcar.c b/drivers/i2c/busses/i2c-rcar.c index 0fc585861610..e59c3f618542 100644 --- a/drivers/i2c/busses/i2c-rcar.c +++ b/drivers/i2c/busses/i2c-rcar.c | |||
@@ -615,7 +615,7 @@ static const struct i2c_algorithm rcar_i2c_algo = { | |||
615 | 615 | ||
616 | static int rcar_i2c_probe(struct platform_device *pdev) | 616 | static int rcar_i2c_probe(struct platform_device *pdev) |
617 | { | 617 | { |
618 | struct i2c_rcar_platform_data *pdata = pdev->dev.platform_data; | 618 | struct i2c_rcar_platform_data *pdata = dev_get_platdata(&pdev->dev); |
619 | struct rcar_i2c_priv *priv; | 619 | struct rcar_i2c_priv *priv; |
620 | struct i2c_adapter *adap; | 620 | struct i2c_adapter *adap; |
621 | struct resource *res; | 621 | struct resource *res; |
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index cab1c91b75a3..0a077b1ef94f 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c | |||
@@ -1033,7 +1033,7 @@ static int s3c24xx_i2c_probe(struct platform_device *pdev) | |||
1033 | int ret; | 1033 | int ret; |
1034 | 1034 | ||
1035 | if (!pdev->dev.of_node) { | 1035 | if (!pdev->dev.of_node) { |
1036 | pdata = pdev->dev.platform_data; | 1036 | pdata = dev_get_platdata(&pdev->dev); |
1037 | if (!pdata) { | 1037 | if (!pdata) { |
1038 | dev_err(&pdev->dev, "no platform data\n"); | 1038 | dev_err(&pdev->dev, "no platform data\n"); |
1039 | return -EINVAL; | 1039 | return -EINVAL; |
diff --git a/drivers/i2c/busses/i2c-s6000.c b/drivers/i2c/busses/i2c-s6000.c index 7c1ca5aca088..dd186a037684 100644 --- a/drivers/i2c/busses/i2c-s6000.c +++ b/drivers/i2c/busses/i2c-s6000.c | |||
@@ -290,8 +290,9 @@ static int s6i2c_probe(struct platform_device *dev) | |||
290 | 290 | ||
291 | clock = 0; | 291 | clock = 0; |
292 | bus_num = -1; | 292 | bus_num = -1; |
293 | if (dev->dev.platform_data) { | 293 | if (dev_get_platdata(&dev->dev)) { |
294 | struct s6_i2c_platform_data *pdata = dev->dev.platform_data; | 294 | struct s6_i2c_platform_data *pdata = |
295 | dev_get_platdata(&dev->dev); | ||
295 | bus_num = pdata->bus_num; | 296 | bus_num = pdata->bus_num; |
296 | clock = pdata->clock; | 297 | clock = pdata->clock; |
297 | } | 298 | } |
diff --git a/drivers/i2c/busses/i2c-sh7760.c b/drivers/i2c/busses/i2c-sh7760.c index 5351a2f34912..5e8f136e233f 100644 --- a/drivers/i2c/busses/i2c-sh7760.c +++ b/drivers/i2c/busses/i2c-sh7760.c | |||
@@ -437,7 +437,7 @@ static int sh7760_i2c_probe(struct platform_device *pdev) | |||
437 | struct cami2c *id; | 437 | struct cami2c *id; |
438 | int ret; | 438 | int ret; |
439 | 439 | ||
440 | pd = pdev->dev.platform_data; | 440 | pd = dev_get_platdata(&pdev->dev); |
441 | if (!pd) { | 441 | if (!pd) { |
442 | dev_err(&pdev->dev, "no platform_data!\n"); | 442 | dev_err(&pdev->dev, "no platform_data!\n"); |
443 | ret = -ENODEV; | 443 | ret = -ENODEV; |
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c index debf745c0268..4e86a3190d46 100644 --- a/drivers/i2c/busses/i2c-sh_mobile.c +++ b/drivers/i2c/busses/i2c-sh_mobile.c | |||
@@ -658,7 +658,7 @@ static int sh_mobile_i2c_hook_irqs(struct platform_device *dev, int hook) | |||
658 | 658 | ||
659 | static int sh_mobile_i2c_probe(struct platform_device *dev) | 659 | static int sh_mobile_i2c_probe(struct platform_device *dev) |
660 | { | 660 | { |
661 | struct i2c_sh_mobile_platform_data *pdata = dev->dev.platform_data; | 661 | struct i2c_sh_mobile_platform_data *pdata = dev_get_platdata(&dev->dev); |
662 | struct sh_mobile_i2c_data *pd; | 662 | struct sh_mobile_i2c_data *pd; |
663 | struct i2c_adapter *adap; | 663 | struct i2c_adapter *adap; |
664 | struct resource *res; | 664 | struct resource *res; |
diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c index 3d0f0520c1b4..433f377b3869 100644 --- a/drivers/i2c/busses/i2c-xiic.c +++ b/drivers/i2c/busses/i2c-xiic.c | |||
@@ -703,7 +703,7 @@ static int xiic_i2c_probe(struct platform_device *pdev) | |||
703 | if (irq < 0) | 703 | if (irq < 0) |
704 | goto resource_missing; | 704 | goto resource_missing; |
705 | 705 | ||
706 | pdata = (struct xiic_i2c_platform_data *) pdev->dev.platform_data; | 706 | pdata = (struct xiic_i2c_platform_data *)dev_get_platdata(&pdev->dev); |
707 | 707 | ||
708 | i2c = kzalloc(sizeof(*i2c), GFP_KERNEL); | 708 | i2c = kzalloc(sizeof(*i2c), GFP_KERNEL); |
709 | if (!i2c) | 709 | if (!i2c) |
diff --git a/drivers/i2c/i2c-smbus.c b/drivers/i2c/i2c-smbus.c index 92cdd2323b03..44d4c6071c15 100644 --- a/drivers/i2c/i2c-smbus.c +++ b/drivers/i2c/i2c-smbus.c | |||
@@ -137,7 +137,7 @@ static irqreturn_t smbalert_irq(int irq, void *d) | |||
137 | static int smbalert_probe(struct i2c_client *ara, | 137 | static int smbalert_probe(struct i2c_client *ara, |
138 | const struct i2c_device_id *id) | 138 | const struct i2c_device_id *id) |
139 | { | 139 | { |
140 | struct i2c_smbus_alert_setup *setup = ara->dev.platform_data; | 140 | struct i2c_smbus_alert_setup *setup = dev_get_platdata(&ara->dev); |
141 | struct i2c_smbus_alert *alert; | 141 | struct i2c_smbus_alert *alert; |
142 | struct i2c_adapter *adapter = ara->adapter; | 142 | struct i2c_adapter *adapter = ara->adapter; |
143 | int res; | 143 | int res; |
diff --git a/drivers/i2c/muxes/i2c-arb-gpio-challenge.c b/drivers/i2c/muxes/i2c-arb-gpio-challenge.c index 210b6f7b9028..f7bf24375f81 100644 --- a/drivers/i2c/muxes/i2c-arb-gpio-challenge.c +++ b/drivers/i2c/muxes/i2c-arb-gpio-challenge.c | |||
@@ -131,7 +131,7 @@ static int i2c_arbitrator_probe(struct platform_device *pdev) | |||
131 | dev_err(dev, "Cannot find device tree node\n"); | 131 | dev_err(dev, "Cannot find device tree node\n"); |
132 | return -ENODEV; | 132 | return -ENODEV; |
133 | } | 133 | } |
134 | if (dev->platform_data) { | 134 | if (dev_get_platdata(dev)) { |
135 | dev_err(dev, "Platform data is not supported\n"); | 135 | dev_err(dev, "Platform data is not supported\n"); |
136 | return -EINVAL; | 136 | return -EINVAL; |
137 | } | 137 | } |
diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c index 5a0ce0081dce..6a206e8d58f4 100644 --- a/drivers/i2c/muxes/i2c-mux-gpio.c +++ b/drivers/i2c/muxes/i2c-mux-gpio.c | |||
@@ -148,12 +148,14 @@ static int i2c_mux_gpio_probe(struct platform_device *pdev) | |||
148 | 148 | ||
149 | platform_set_drvdata(pdev, mux); | 149 | platform_set_drvdata(pdev, mux); |
150 | 150 | ||
151 | if (!pdev->dev.platform_data) { | 151 | if (!dev_get_platdata(&pdev->dev)) { |
152 | ret = i2c_mux_gpio_probe_dt(mux, pdev); | 152 | ret = i2c_mux_gpio_probe_dt(mux, pdev); |
153 | if (ret < 0) | 153 | if (ret < 0) |
154 | return ret; | 154 | return ret; |
155 | } else | 155 | } else { |
156 | memcpy(&mux->data, pdev->dev.platform_data, sizeof(mux->data)); | 156 | memcpy(&mux->data, dev_get_platdata(&pdev->dev), |
157 | sizeof(mux->data)); | ||
158 | } | ||
157 | 159 | ||
158 | /* | 160 | /* |
159 | * If a GPIO chip name is provided, the GPIO pin numbers provided are | 161 | * If a GPIO chip name is provided, the GPIO pin numbers provided are |
diff --git a/drivers/i2c/muxes/i2c-mux-pca9541.c b/drivers/i2c/muxes/i2c-mux-pca9541.c index 966a18a5d12d..c4f08ad31183 100644 --- a/drivers/i2c/muxes/i2c-mux-pca9541.c +++ b/drivers/i2c/muxes/i2c-mux-pca9541.c | |||
@@ -324,7 +324,7 @@ static int pca9541_probe(struct i2c_client *client, | |||
324 | const struct i2c_device_id *id) | 324 | const struct i2c_device_id *id) |
325 | { | 325 | { |
326 | struct i2c_adapter *adap = client->adapter; | 326 | struct i2c_adapter *adap = client->adapter; |
327 | struct pca954x_platform_data *pdata = client->dev.platform_data; | 327 | struct pca954x_platform_data *pdata = dev_get_platdata(&client->dev); |
328 | struct pca9541 *data; | 328 | struct pca9541 *data; |
329 | int force; | 329 | int force; |
330 | int ret = -ENODEV; | 330 | int ret = -ENODEV; |
diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c index a531d801dbe4..bad5b84a5985 100644 --- a/drivers/i2c/muxes/i2c-mux-pca954x.c +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c | |||
@@ -185,7 +185,7 @@ static int pca954x_probe(struct i2c_client *client, | |||
185 | const struct i2c_device_id *id) | 185 | const struct i2c_device_id *id) |
186 | { | 186 | { |
187 | struct i2c_adapter *adap = to_i2c_adapter(client->dev.parent); | 187 | struct i2c_adapter *adap = to_i2c_adapter(client->dev.parent); |
188 | struct pca954x_platform_data *pdata = client->dev.platform_data; | 188 | struct pca954x_platform_data *pdata = dev_get_platdata(&client->dev); |
189 | int num, force, class; | 189 | int num, force, class; |
190 | struct pca954x *data; | 190 | struct pca954x *data; |
191 | int ret = -ENODEV; | 191 | int ret = -ENODEV; |
diff --git a/drivers/i2c/muxes/i2c-mux-pinctrl.c b/drivers/i2c/muxes/i2c-mux-pinctrl.c index a43c0ce5e3d8..0d082027c29a 100644 --- a/drivers/i2c/muxes/i2c-mux-pinctrl.c +++ b/drivers/i2c/muxes/i2c-mux-pinctrl.c | |||
@@ -145,7 +145,7 @@ static int i2c_mux_pinctrl_probe(struct platform_device *pdev) | |||
145 | 145 | ||
146 | mux->dev = &pdev->dev; | 146 | mux->dev = &pdev->dev; |
147 | 147 | ||
148 | mux->pdata = pdev->dev.platform_data; | 148 | mux->pdata = dev_get_platdata(&pdev->dev); |
149 | if (!mux->pdata) { | 149 | if (!mux->pdata) { |
150 | ret = i2c_mux_pinctrl_parse_dt(mux, pdev); | 150 | ret = i2c_mux_pinctrl_parse_dt(mux, pdev); |
151 | if (ret < 0) | 151 | if (ret < 0) |