Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 66e78413 authored by Geliang Tang's avatar Geliang Tang Committed by Wolfram Sang
Browse files

i2c: st: use to_platform_device()



Use to_platform_device() instead of open-coding it.

Signed-off-by: default avatarGeliang Tang <geliangtang@163.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 238c44a7
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -708,8 +708,7 @@ static int st_i2c_xfer(struct i2c_adapter *i2c_adap,
#ifdef CONFIG_PM_SLEEP
#ifdef CONFIG_PM_SLEEP
static int st_i2c_suspend(struct device *dev)
static int st_i2c_suspend(struct device *dev)
{
{
	struct platform_device *pdev =
	struct platform_device *pdev = to_platform_device(dev);
		container_of(dev, struct platform_device, dev);
	struct st_i2c_dev *i2c_dev = platform_get_drvdata(pdev);
	struct st_i2c_dev *i2c_dev = platform_get_drvdata(pdev);


	if (i2c_dev->busy)
	if (i2c_dev->busy)