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>
This commit is contained in:

committed by
Wolfram Sang

parent
f2326401b8
commit
9242e72aae
@@ -457,8 +457,7 @@ static int i2c_lpc2k_remove(struct platform_device *dev)
|
||||
#ifdef CONFIG_PM
|
||||
static int i2c_lpc2k_suspend(struct device *dev)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct lpc2k_i2c *i2c = platform_get_drvdata(pdev);
|
||||
struct lpc2k_i2c *i2c = dev_get_drvdata(dev);
|
||||
|
||||
clk_disable(i2c->clk);
|
||||
|
||||
@@ -467,8 +466,7 @@ static int i2c_lpc2k_suspend(struct device *dev)
|
||||
|
||||
static int i2c_lpc2k_resume(struct device *dev)
|
||||
{
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct lpc2k_i2c *i2c = platform_get_drvdata(pdev);
|
||||
struct lpc2k_i2c *i2c = dev_get_drvdata(dev);
|
||||
|
||||
clk_enable(i2c->clk);
|
||||
i2c_lpc2k_reset(i2c);
|
||||
|
Reference in New Issue
Block a user