Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Andy Shevchenko and committed by
Jonathan Cameron
571b97fd 85a6b728

+2 -2
+2 -2
drivers/iio/light/tsl2563.c
··· 795 795 796 796 static int tsl2563_suspend(struct device *dev) 797 797 { 798 - struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); 798 + struct iio_dev *indio_dev = dev_get_drvdata(dev); 799 799 struct tsl2563_chip *chip = iio_priv(indio_dev); 800 800 int ret; 801 801 ··· 814 814 815 815 static int tsl2563_resume(struct device *dev) 816 816 { 817 - struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); 817 + struct iio_dev *indio_dev = dev_get_drvdata(dev); 818 818 struct tsl2563_chip *chip = iio_priv(indio_dev); 819 819 int ret; 820 820