i2c: 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: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user