diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-07-27 19:16:24 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2017-07-31 18:03:32 +0300 |
commit | 9242e72aaea05c0fce2003a8efa48f403d87a5bf (patch) | |
tree | 5455132d3d29c84bba3bfb467a90269d0a59e2d6 /drivers/i2c/busses/i2c-sirf.c | |
parent | f2326401b8ff8a646092562d272ed50d9cf99c6c (diff) | |
download | linux-9242e72aaea05c0fce2003a8efa48f403d87a5bf.tar.xz |
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-sirf.c')
-rw-r--r-- | drivers/i2c/busses/i2c-sirf.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-sirf.c b/drivers/i2c/busses/i2c-sirf.c index 95e81d0f72b4..2fd8b6d00391 100644 --- a/drivers/i2c/busses/i2c-sirf.c +++ b/drivers/i2c/busses/i2c-sirf.c @@ -421,8 +421,7 @@ static int i2c_sirfsoc_remove(struct platform_device *pdev) #ifdef CONFIG_PM static int i2c_sirfsoc_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct i2c_adapter *adapter = platform_get_drvdata(pdev); + struct i2c_adapter *adapter = dev_get_drvdata(dev); struct sirfsoc_i2c *siic = adapter->algo_data; clk_enable(siic->clk); @@ -434,8 +433,7 @@ static int i2c_sirfsoc_suspend(struct device *dev) static int i2c_sirfsoc_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct i2c_adapter *adapter = platform_get_drvdata(pdev); + struct i2c_adapter *adapter = dev_get_drvdata(dev); struct sirfsoc_i2c *siic = adapter->algo_data; clk_enable(siic->clk); |