diff options
Diffstat (limited to 'drivers/i2c/muxes/i2c-mux-gpio.c')
-rw-r--r-- | drivers/i2c/muxes/i2c-mux-gpio.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c index 5a0ce00..6a206e8 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) 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 |