Commit 0fc1347a authored by Jingchang Lu's avatar Jingchang Lu Committed by Wolfram Sang

i2c: imx: don't change platform device id_entry directly

The id_entry field should be changed by platform driver core,
driver should prevent changing it derectly. Use local variable
to save and extract platform_device_id info of the dts devices
instead.
Signed-off-by: default avatarJingchang Lu <b35083@freescale.com>
Reviewed-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 46f2832b
...@@ -499,6 +499,7 @@ static int __init i2c_imx_probe(struct platform_device *pdev) ...@@ -499,6 +499,7 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
struct imx_i2c_struct *i2c_imx; struct imx_i2c_struct *i2c_imx;
struct resource *res; struct resource *res;
struct imxi2c_platform_data *pdata = pdev->dev.platform_data; struct imxi2c_platform_data *pdata = pdev->dev.platform_data;
const struct platform_device_id *imx_id;
void __iomem *base; void __iomem *base;
int irq, ret; int irq, ret;
u32 bitrate; u32 bitrate;
...@@ -524,8 +525,11 @@ static int __init i2c_imx_probe(struct platform_device *pdev) ...@@ -524,8 +525,11 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
} }
if (of_id) if (of_id)
pdev->id_entry = of_id->data; imx_id = of_id->data;
i2c_imx->devtype = pdev->id_entry->driver_data; else
imx_id = platform_get_device_id(pdev);
i2c_imx->devtype = imx_id->driver_data;
/* Setup i2c_imx driver structure */ /* Setup i2c_imx driver structure */
strlcpy(i2c_imx->adapter.name, pdev->name, sizeof(i2c_imx->adapter.name)); strlcpy(i2c_imx->adapter.name, pdev->name, sizeof(i2c_imx->adapter.name));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment