From: Felipe Balbi Date: Mon, 13 Jul 2015 20:38:02 +0000 (-0500) Subject: i2c: omap: switch to dev_get_drvdata() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c680e3291857216465714ba1d3336befaa5b4725;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git i2c: omap: switch to dev_get_drvdata() 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 Acked-by: Alexander Sverdlin Signed-off-by: Wolfram Sang --- diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index fc9bf7f30e35..ce34f431a3ac 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -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);