summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-cadence.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-07-27 18:16:24 +0200
committerWolfram Sang <wsa@the-dreams.de>2017-07-31 17:03:32 +0200
commit9242e72aaea05c0fce2003a8efa48f403d87a5bf (patch)
tree5455132d3d29c84bba3bfb467a90269d0a59e2d6 /drivers/i2c/busses/i2c-cadence.c
parenti2c: mediatek: send i2c master code at 400k (diff)
downloadlinux-9242e72aaea05c0fce2003a8efa48f403d87a5bf.tar.xz
linux-9242e72aaea05c0fce2003a8efa48f403d87a5bf.zip
i2c: use dev_get_drvdata() to get private data in suspend/resume hooks
Several drivers call to_platform_device() to get platform_device and pass it to platform_get_drvdata(). In platform_get_drvdata(), the platform_device is converted back to struct device again. Use dev_get_drvdata() to avoid platform_device/device dance. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> (for DesignWare only) Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-cadence.c')
-rw-r--r--drivers/i2c/busses/i2c-cadence.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-cadence.c b/drivers/i2c/busses/i2c-cadence.c
index 75d80161931f..b13605718291 100644
--- a/drivers/i2c/busses/i2c-cadence.c
+++ b/drivers/i2c/busses/i2c-cadence.c
@@ -826,8 +826,7 @@ static int cdns_i2c_clk_notifier_cb(struct notifier_block *nb, unsigned long
*/
static int __maybe_unused cdns_i2c_runtime_suspend(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct cdns_i2c *xi2c = platform_get_drvdata(pdev);
+ struct cdns_i2c *xi2c = dev_get_drvdata(dev);
clk_disable(xi2c->clk);
@@ -844,8 +843,7 @@ static int __maybe_unused cdns_i2c_runtime_suspend(struct device *dev)
*/
static int __maybe_unused cdns_i2c_runtime_resume(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct cdns_i2c *xi2c = platform_get_drvdata(pdev);
+ struct cdns_i2c *xi2c = dev_get_drvdata(dev);
int ret;
ret = clk_enable(xi2c->clk);