diff options
Diffstat (limited to 'drivers/i2c/muxes/i2c-mux-gpio.c')
-rw-r--r-- | drivers/i2c/muxes/i2c-mux-gpio.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c index 5a0ce0081dce..5d4a99ba743e 100644 --- a/drivers/i2c/muxes/i2c-mux-gpio.c +++ b/drivers/i2c/muxes/i2c-mux-gpio.c @@ -16,7 +16,6 @@ #include <linux/module.h> #include <linux/slab.h> #include <linux/gpio.h> -#include <linux/of_i2c.h> #include <linux/of_gpio.h> struct gpiomux { @@ -148,12 +147,14 @@ static int i2c_mux_gpio_probe(struct platform_device *pdev) platform_set_drvdata(pdev, mux); - if (!pdev->dev.platform_data) { + if (!dev_get_platdata(&pdev->dev)) { ret = i2c_mux_gpio_probe_dt(mux, pdev); if (ret < 0) return ret; - } else - memcpy(&mux->data, pdev->dev.platform_data, sizeof(mux->data)); + } else { + memcpy(&mux->data, dev_get_platdata(&pdev->dev), + sizeof(mux->data)); + } /* * If a GPIO chip name is provided, the GPIO pin numbers provided are |