Commit ebbdcba2 authored by Wolfram Sang's avatar Wolfram Sang Committed by Jonathan Cameron

iio: common: hid-sensors: simplify getting .drvdata

We should get drvdata from struct device directly. Going via
platform_device is an unneeded step back and forth.
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent eb84ce74
...@@ -304,8 +304,7 @@ EXPORT_SYMBOL(hid_sensor_setup_trigger); ...@@ -304,8 +304,7 @@ EXPORT_SYMBOL(hid_sensor_setup_trigger);
static int __maybe_unused hid_sensor_suspend(struct device *dev) static int __maybe_unused hid_sensor_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct hid_sensor_common *attrb = iio_device_get_drvdata(indio_dev); struct hid_sensor_common *attrb = iio_device_get_drvdata(indio_dev);
return _hid_sensor_power_state(attrb, false); return _hid_sensor_power_state(attrb, false);
...@@ -313,8 +312,7 @@ static int __maybe_unused hid_sensor_suspend(struct device *dev) ...@@ -313,8 +312,7 @@ static int __maybe_unused hid_sensor_suspend(struct device *dev)
static int __maybe_unused hid_sensor_resume(struct device *dev) static int __maybe_unused hid_sensor_resume(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct hid_sensor_common *attrb = iio_device_get_drvdata(indio_dev); struct hid_sensor_common *attrb = iio_device_get_drvdata(indio_dev);
schedule_work(&attrb->work); schedule_work(&attrb->work);
return 0; return 0;
...@@ -322,8 +320,7 @@ static int __maybe_unused hid_sensor_resume(struct device *dev) ...@@ -322,8 +320,7 @@ static int __maybe_unused hid_sensor_resume(struct device *dev)
static int __maybe_unused hid_sensor_runtime_resume(struct device *dev) static int __maybe_unused hid_sensor_runtime_resume(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct hid_sensor_common *attrb = iio_device_get_drvdata(indio_dev); struct hid_sensor_common *attrb = iio_device_get_drvdata(indio_dev);
return _hid_sensor_power_state(attrb, true); return _hid_sensor_power_state(attrb, true);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment