Commit c2c64954 authored by Jingoo Han's avatar Jingoo Han Committed by Wolfram Sang

i2c: use platform_{get,set}_drvdata()

Use the wrapper functions for getting and setting the driver data using
platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev,
so we can directly pass a struct platform_device.
Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 3cc2d009
...@@ -646,7 +646,7 @@ static int cpm_i2c_probe(struct platform_device *ofdev) ...@@ -646,7 +646,7 @@ static int cpm_i2c_probe(struct platform_device *ofdev)
cpm->ofdev = ofdev; cpm->ofdev = ofdev;
dev_set_drvdata(&ofdev->dev, cpm); platform_set_drvdata(ofdev, cpm);
cpm->adap = cpm_ops; cpm->adap = cpm_ops;
i2c_set_adapdata(&cpm->adap, cpm); i2c_set_adapdata(&cpm->adap, cpm);
...@@ -689,7 +689,7 @@ static int cpm_i2c_probe(struct platform_device *ofdev) ...@@ -689,7 +689,7 @@ static int cpm_i2c_probe(struct platform_device *ofdev)
static int cpm_i2c_remove(struct platform_device *ofdev) static int cpm_i2c_remove(struct platform_device *ofdev)
{ {
struct cpm_i2c *cpm = dev_get_drvdata(&ofdev->dev); struct cpm_i2c *cpm = platform_get_drvdata(ofdev);
i2c_del_adapter(&cpm->adap); i2c_del_adapter(&cpm->adap);
......
...@@ -705,7 +705,7 @@ static int iic_probe(struct platform_device *ofdev) ...@@ -705,7 +705,7 @@ static int iic_probe(struct platform_device *ofdev)
return -ENOMEM; return -ENOMEM;
} }
dev_set_drvdata(&ofdev->dev, dev); platform_set_drvdata(ofdev, dev);
dev->vaddr = of_iomap(np, 0); dev->vaddr = of_iomap(np, 0);
if (dev->vaddr == NULL) { if (dev->vaddr == NULL) {
...@@ -782,7 +782,7 @@ static int iic_probe(struct platform_device *ofdev) ...@@ -782,7 +782,7 @@ static int iic_probe(struct platform_device *ofdev)
*/ */
static int iic_remove(struct platform_device *ofdev) static int iic_remove(struct platform_device *ofdev)
{ {
struct ibm_iic_private *dev = dev_get_drvdata(&ofdev->dev); struct ibm_iic_private *dev = platform_get_drvdata(ofdev);
i2c_del_adapter(&dev->adap); i2c_del_adapter(&dev->adap);
......
...@@ -679,7 +679,7 @@ static int fsl_i2c_probe(struct platform_device *op) ...@@ -679,7 +679,7 @@ static int fsl_i2c_probe(struct platform_device *op)
} }
dev_info(i2c->dev, "timeout %u us\n", mpc_ops.timeout * 1000000 / HZ); dev_info(i2c->dev, "timeout %u us\n", mpc_ops.timeout * 1000000 / HZ);
dev_set_drvdata(&op->dev, i2c); platform_set_drvdata(op, i2c);
i2c->adap = mpc_ops; i2c->adap = mpc_ops;
i2c_set_adapdata(&i2c->adap, i2c); i2c_set_adapdata(&i2c->adap, i2c);
...@@ -707,7 +707,7 @@ static int fsl_i2c_probe(struct platform_device *op) ...@@ -707,7 +707,7 @@ static int fsl_i2c_probe(struct platform_device *op)
static int fsl_i2c_remove(struct platform_device *op) static int fsl_i2c_remove(struct platform_device *op)
{ {
struct mpc_i2c *i2c = dev_get_drvdata(&op->dev); struct mpc_i2c *i2c = platform_get_drvdata(op);
i2c_del_adapter(&i2c->adap); i2c_del_adapter(&i2c->adap);
......
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