aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJingchang Lu <b35083@freescale.com>2013-08-07 05:05:38 -0400
committerWolfram Sang <wsa@the-dreams.de>2013-08-15 10:12:14 -0400
commit0fc1347a7fdbcc25204f737998b824fc46662afd (patch)
treefde085cafd0e4c54036cc7e6f81ccbb7c8187e4e
parent46f2832b9f66b008fb813fe153f27794412fbc4f (diff)
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: Jingchang Lu <b35083@freescale.com> Reviewed-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
-rw-r--r--drivers/i2c/busses/i2c-imx.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c
index 7adb35115d95..cbea84bfb0e8 100644
--- a/drivers/i2c/busses/i2c-imx.c
+++ b/drivers/i2c/busses/i2c-imx.c
@@ -499,6 +499,7 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
499 struct imx_i2c_struct *i2c_imx; 499 struct imx_i2c_struct *i2c_imx;
500 struct resource *res; 500 struct resource *res;
501 struct imxi2c_platform_data *pdata = pdev->dev.platform_data; 501 struct imxi2c_platform_data *pdata = pdev->dev.platform_data;
502 const struct platform_device_id *imx_id;
502 void __iomem *base; 503 void __iomem *base;
503 int irq, ret; 504 int irq, ret;
504 u32 bitrate; 505 u32 bitrate;
@@ -524,8 +525,11 @@ static int __init i2c_imx_probe(struct platform_device *pdev)
524 } 525 }
525 526
526 if (of_id) 527 if (of_id)
527 pdev->id_entry = of_id->data; 528 imx_id = of_id->data;
528 i2c_imx->devtype = pdev->id_entry->driver_data; 529 else
530 imx_id = platform_get_device_id(pdev);
531
532 i2c_imx->devtype = imx_id->driver_data;
529 533
530 /* Setup i2c_imx driver structure */ 534 /* Setup i2c_imx driver structure */
531 strlcpy(i2c_imx->adapter.name, pdev->name, sizeof(i2c_imx->adapter.name)); 535 strlcpy(i2c_imx->adapter.name, pdev->name, sizeof(i2c_imx->adapter.name));