diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2022-12-07 20:03:46 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-12-28 18:19:46 +0100 |
commit | 571b97fd8777234fcd1f94ed36781bed39f1e20d (patch) | |
tree | 0a741bb1ab92b259cbd385700ac35bd7d87d4d78 /drivers | |
parent | iio: light: tsl2563: Utilise temporary variable for struct device (diff) | |
download | linux-571b97fd8777234fcd1f94ed36781bed39f1e20d.tar.xz linux-571b97fd8777234fcd1f94ed36781bed39f1e20d.zip |
iio: light: tsl2563: Use dev_get_drvdata() directly in PM callbacks
PM callbacks take struct device pointer as a parameter, use
dev_get_drvdata() to retrieve it instead of unneeded double
loop of referencing via i2c_get_clientdata(to_i2c_client(dev)).
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Ferry Toth <ftoth@exalondelft.nl>
Link: https://lore.kernel.org/r/20221207190348.9347-9-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/iio/light/tsl2563.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c index c5814545fd19..f92190fadffd 100644 --- a/drivers/iio/light/tsl2563.c +++ b/drivers/iio/light/tsl2563.c @@ -795,7 +795,7 @@ static void tsl2563_remove(struct i2c_client *client) static int tsl2563_suspend(struct device *dev) { - struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); + struct iio_dev *indio_dev = dev_get_drvdata(dev); struct tsl2563_chip *chip = iio_priv(indio_dev); int ret; @@ -814,7 +814,7 @@ out: static int tsl2563_resume(struct device *dev) { - struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); + struct iio_dev *indio_dev = dev_get_drvdata(dev); struct tsl2563_chip *chip = iio_priv(indio_dev); int ret; |