Skip to content

Commit

Permalink
i2c: st: use to_platform_device()
Browse files Browse the repository at this point in the history
Use to_platform_device() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  • Loading branch information
Geliang Tang authored and Wolfram Sang committed Jan 3, 2016
1 parent 238c44a commit 66e7841
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/i2c/busses/i2c-st.c
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,7 @@ static int st_i2c_xfer(struct i2c_adapter *i2c_adap,
#ifdef CONFIG_PM_SLEEP
static int st_i2c_suspend(struct device *dev)
{
struct platform_device *pdev =
container_of(dev, struct platform_device, dev);
struct platform_device *pdev = to_platform_device(dev);
struct st_i2c_dev *i2c_dev = platform_get_drvdata(pdev);

if (i2c_dev->busy)
Expand Down

0 comments on commit 66e7841

Please sign in to comment.