summaryrefslogtreecommitdiff
path: root/drivers/iio/common
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2021-09-20 12:05:18 +0300
committerEnric Balletbo i Serra <enric.balletbo@collabora.com>2021-09-27 10:18:01 +0300
commitf636fb044ad6a4bea1032cf65e2fe0dd04332265 (patch)
treebea0cb80f677cac7973b2d37cb654983f2c602ef /drivers/iio/common
parent73eff8602ad10cb55cdb614241b18f3d842abbe1 (diff)
downloadlinux-f636fb044ad6a4bea1032cf65e2fe0dd04332265.tar.xz
iio: common: cros_ec_sensors: simplify getting .driver_data
We should get 'driver_data' from 'struct device' directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Link: https://lore.kernel.org/r/20210920090522.23784-7-wsa+renesas@sang-engineering.com
Diffstat (limited to 'drivers/iio/common')
-rw-r--r--drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
index 28bde13003b7..b2725c6adc7f 100644
--- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
+++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
@@ -831,8 +831,7 @@ EXPORT_SYMBOL_GPL(cros_ec_sensors_core_write);
static int __maybe_unused cros_ec_sensors_resume(struct device *dev)
{
- struct platform_device *pdev = to_platform_device(dev);
- struct iio_dev *indio_dev = platform_get_drvdata(pdev);
+ struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct cros_ec_sensors_core_state *st = iio_priv(indio_dev);
int ret = 0;