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:
Jingoo Han
2013-07-30 16:59:33 +09:00
committed by Wolfram Sang
parent cda2109a26
commit 6d4028c644
25 changed files with 40 additions and 35 deletions

View File

@@ -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