Skip to content

Commit

Permalink
i2c: omap: switch to dev_get_drvdata()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Felipe Balbi authored and Wolfram Sang committed Aug 10, 2015
1 parent 2022611 commit c680e32
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/i2c/busses/i2c-omap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand Down

0 comments on commit c680e32

Please sign in to comment.