i2c: use platform_{get,set}_drvdata()
authorJingoo Han <jg1.han@samsung.com>
Thu, 23 May 2013 10:22:40 +0000 (19:22 +0900)
committerWolfram Sang <wsa@the-dreams.de>
Wed, 12 Jun 2013 18:39:07 +0000 (20:39 +0200)
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: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-cpm.c
drivers/i2c/busses/i2c-ibm_iic.c
drivers/i2c/busses/i2c-mpc.c

index 3823623baa481b5b42251a894d462dc47de115b2..eccf5c2d4a1218ee5a04d4fa9f43ad0c39f9aa80 100644 (file)
@@ -646,7 +646,7 @@ static int cpm_i2c_probe(struct platform_device *ofdev)
 
        cpm->ofdev = ofdev;
 
-       dev_set_drvdata(&ofdev->dev, cpm);
+       platform_set_drvdata(ofdev, cpm);
 
        cpm->adap = cpm_ops;
        i2c_set_adapdata(&cpm->adap, cpm);
@@ -689,7 +689,7 @@ out_free:
 
 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);
 
index 405a2e240454336cbed84566a7a74bbf6593da7c..973f51688276cd160de29d6483e1376a3c29ea44 100644 (file)
@@ -705,7 +705,7 @@ static int iic_probe(struct platform_device *ofdev)
                return -ENOMEM;
        }
 
-       dev_set_drvdata(&ofdev->dev, dev);
+       platform_set_drvdata(ofdev, dev);
 
        dev->vaddr = of_iomap(np, 0);
        if (dev->vaddr == NULL) {
@@ -782,7 +782,7 @@ error_cleanup:
  */
 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);
 
index 5e705ee02f4a9e2db2afa6a7043516022a53e117..7607dc0619184eaa4100c7edbb8590525df5d2f3 100644 (file)
@@ -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_set_drvdata(&op->dev, i2c);
+       platform_set_drvdata(op, i2c);
 
        i2c->adap = mpc_ops;
        i2c_set_adapdata(&i2c->adap, i2c);
@@ -707,7 +707,7 @@ static int fsl_i2c_probe(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);