Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d4028c6 authored by Jingoo Han's avatar Jingoo Han Committed by Wolfram Sang
Browse files

i2c: use dev_get_platdata()



Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent cda2109a
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -674,7 +674,8 @@ static int i2c_bfin_twi_probe(struct platform_device *pdev)
	p_adap->timeout = 5 * HZ;
	p_adap->retries = 3;

	rc = peripheral_request_list((unsigned short *)pdev->dev.platform_data,
	rc = peripheral_request_list(
			(unsigned short *)dev_get_platdata(&pdev->dev),
			"i2c-bfin-twi");
	if (rc) {
		dev_err(&pdev->dev, "Can't setup pin mux!\n");
@@ -722,7 +723,7 @@ static int i2c_bfin_twi_probe(struct platform_device *pdev)
	free_irq(iface->irq, iface);
out_error_req_irq:
out_error_no_irq:
	peripheral_free_list((unsigned short *)pdev->dev.platform_data);
	peripheral_free_list((unsigned short *)dev_get_platdata(&pdev->dev));
out_error_pin_mux:
	iounmap(iface->regs_base);
out_error_ioremap:
@@ -738,7 +739,7 @@ static int i2c_bfin_twi_remove(struct platform_device *pdev)

	i2c_del_adapter(&(iface->adap));
	free_irq(iface->irq, iface);
	peripheral_free_list((unsigned short *)pdev->dev.platform_data);
	peripheral_free_list((unsigned short *)dev_get_platdata(&pdev->dev));
	iounmap(iface->regs_base);
	kfree(iface);

+3 −2
Original line number Diff line number Diff line
@@ -233,8 +233,9 @@ static int cbus_i2c_probe(struct platform_device *pdev)
		chost->clk_gpio = of_get_gpio(dnode, 0);
		chost->dat_gpio = of_get_gpio(dnode, 1);
		chost->sel_gpio = of_get_gpio(dnode, 2);
	} else if (pdev->dev.platform_data) {
		struct i2c_cbus_platform_data *pdata = pdev->dev.platform_data;
	} else if (dev_get_platdata(&pdev->dev)) {
		struct i2c_cbus_platform_data *pdata =
			dev_get_platdata(&pdev->dev);
		chost->clk_gpio = pdata->clk_gpio;
		chost->dat_gpio = pdata->dat_gpio;
		chost->sel_gpio = pdata->sel_gpio;
+1 −1
Original line number Diff line number Diff line
@@ -663,7 +663,7 @@ static int davinci_i2c_probe(struct platform_device *pdev)
#endif
	dev->dev = &pdev->dev;
	dev->irq = irq->start;
	dev->pdata = dev->dev->platform_data;
	dev->pdata = dev_get_platdata(&dev->dev);
	platform_set_drvdata(pdev, dev);

	if (!dev->pdata && pdev->dev.of_node) {
+3 −3
Original line number Diff line number Diff line
@@ -137,9 +137,9 @@ static int i2c_gpio_probe(struct platform_device *pdev)
		if (ret)
			return ret;
	} else {
		if (!pdev->dev.platform_data)
		if (!dev_get_platdata(&pdev->dev))
			return -ENXIO;
		pdata = pdev->dev.platform_data;
		pdata = dev_get_platdata(&pdev->dev);
		sda_pin = pdata->sda_pin;
		scl_pin = pdata->scl_pin;
	}
@@ -171,7 +171,7 @@ static int i2c_gpio_probe(struct platform_device *pdev)
		pdata->scl_pin = scl_pin;
		of_i2c_gpio_get_props(pdev->dev.of_node, pdata);
	} else {
		memcpy(pdata, pdev->dev.platform_data, sizeof(*pdata));
		memcpy(pdata, dev_get_platdata(&pdev->dev), sizeof(*pdata));
	}

	if (pdata->sda_is_open_drain) {
+1 −1
Original line number Diff line number Diff line
@@ -596,7 +596,7 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
							   &pdev->dev);
	struct imx_i2c_struct *i2c_imx;
	struct resource *res;
	struct imxi2c_platform_data *pdata = pdev->dev.platform_data;
	struct imxi2c_platform_data *pdata = dev_get_platdata(&pdev->dev);
	void __iomem *base;
	int irq, ret;
	u32 bitrate;
Loading