i2c: omap: switch to dev_get_drvdata()
authorFelipe Balbi <balbi@ti.com>
Mon, 13 Jul 2015 20:38:02 +0000 (15:38 -0500)
committerWolfram Sang <wsa@the-dreams.de>
Mon, 10 Aug 2015 06:37:28 +0000 (08:37 +0200)
there's no need to fetch the platform_device
in order to dereference it back to the dev
pointer to access drvdata, we can use
dev_get_drvdata() instead.

Signed-off-by: Felipe Balbi <balbi@ti.com>
Acked-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-omap.c

index fc9bf7f30e355dfadfcadd4f7d8f187f818e9566..ce34f431a3ac4c8ac635567bbea094cd3234feda 100644 (file)
@@ -1476,8 +1476,7 @@ static int omap_i2c_remove(struct platform_device *pdev)
 #ifdef CONFIG_PM
 static int omap_i2c_runtime_suspend(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct omap_i2c_dev *_dev = platform_get_drvdata(pdev);
+       struct omap_i2c_dev *_dev = dev_get_drvdata(dev);
 
        _dev->iestate = omap_i2c_read_reg(_dev, OMAP_I2C_IE_REG);
 
@@ -1503,8 +1502,7 @@ static int omap_i2c_runtime_suspend(struct device *dev)
 
 static int omap_i2c_runtime_resume(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct omap_i2c_dev *_dev = platform_get_drvdata(pdev);
+       struct omap_i2c_dev *_dev = dev_get_drvdata(dev);
 
        pinctrl_pm_select_default_state(dev);
 
This page took 0.028925 seconds and 5 git commands to generate.