Commit 2e1f44d8 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Jonathan Cameron

iio: hid-sensors: avoid unused function warning

A small rework of the PM code in this driver introduced a harmless
warning when CONFIG_PM_SLEEP is not set:

drivers/iio/common/hid-sensors/hid-sensor-trigger.c:212:12: error: 'hid_sensor_resume' defined but not used [-Werror=unused-function]

This removes the #ifdef and instead marks all three PM functions
as __maybe_unused, which covers all possible cases and is harder
to get wrong.
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Fixes: 7f6cf741 ("iio: hid-sensors: use asynchronous resume")
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 943bbe74
...@@ -199,8 +199,7 @@ int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name, ...@@ -199,8 +199,7 @@ int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name,
} }
EXPORT_SYMBOL(hid_sensor_setup_trigger); EXPORT_SYMBOL(hid_sensor_setup_trigger);
#ifdef CONFIG_PM static int __maybe_unused hid_sensor_suspend(struct device *dev)
static int hid_sensor_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct iio_dev *indio_dev = platform_get_drvdata(pdev); struct iio_dev *indio_dev = platform_get_drvdata(pdev);
...@@ -209,7 +208,7 @@ static int hid_sensor_suspend(struct device *dev) ...@@ -209,7 +208,7 @@ static int hid_sensor_suspend(struct device *dev)
return _hid_sensor_power_state(attrb, false); return _hid_sensor_power_state(attrb, false);
} }
static int 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 platform_device *pdev = to_platform_device(dev);
struct iio_dev *indio_dev = platform_get_drvdata(pdev); struct iio_dev *indio_dev = platform_get_drvdata(pdev);
...@@ -218,7 +217,7 @@ static int hid_sensor_resume(struct device *dev) ...@@ -218,7 +217,7 @@ static int hid_sensor_resume(struct device *dev)
return 0; return 0;
} }
static int 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 platform_device *pdev = to_platform_device(dev);
struct iio_dev *indio_dev = platform_get_drvdata(pdev); struct iio_dev *indio_dev = platform_get_drvdata(pdev);
...@@ -226,8 +225,6 @@ static int hid_sensor_runtime_resume(struct device *dev) ...@@ -226,8 +225,6 @@ static int hid_sensor_runtime_resume(struct device *dev)
return _hid_sensor_power_state(attrb, true); return _hid_sensor_power_state(attrb, true);
} }
#endif
const struct dev_pm_ops hid_sensor_pm_ops = { const struct dev_pm_ops hid_sensor_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(hid_sensor_suspend, hid_sensor_resume) SET_SYSTEM_SLEEP_PM_OPS(hid_sensor_suspend, hid_sensor_resume)
SET_RUNTIME_PM_OPS(hid_sensor_suspend, SET_RUNTIME_PM_OPS(hid_sensor_suspend,
......
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