Skip to content

Commit f636fb0

Browse files
Wolfram SangEnric Balletbo i Serra
authored andcommitted
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 <[email protected]> Acked-by: Jonathan Cameron <[email protected]> Signed-off-by: Enric Balletbo i Serra <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 73eff86 commit f636fb0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -831,8 +831,7 @@ EXPORT_SYMBOL_GPL(cros_ec_sensors_core_write);
831831

832832
static int __maybe_unused cros_ec_sensors_resume(struct device *dev)
833833
{
834-
struct platform_device *pdev = to_platform_device(dev);
835-
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
834+
struct iio_dev *indio_dev = dev_get_drvdata(dev);
836835
struct cros_ec_sensors_core_state *st = iio_priv(indio_dev);
837836
int ret = 0;
838837

0 commit comments

Comments
 (0)