diff options
author | Arnd Bergmann <arnd@arndb.de> | 2016-08-26 11:29:35 -0400 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2016-08-29 14:54:08 -0400 |
commit | 2e1f44d8a7724e889f1a4f211aad13320cb80f1f (patch) | |
tree | 2358d5be881e3b95ab431a1afda525a4604cab97 /drivers/iio/common | |
parent | 943bbe743ce4c2846c41812186411841b0c9d7a1 (diff) |
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: Arnd Bergmann <arnd@arndb.de>
Fixes: 7f6cf7414538 ("iio: hid-sensors: use asynchronous resume")
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/common')
-rw-r--r-- | drivers/iio/common/hid-sensors/hid-sensor-trigger.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c index 5264ed6e03e5..a3cce3a38300 100644 --- a/drivers/iio/common/hid-sensors/hid-sensor-trigger.c +++ b/drivers/iio/common/hid-sensors/hid-sensor-trigger.c | |||
@@ -199,8 +199,7 @@ error_ret: | |||
199 | } | 199 | } |
200 | EXPORT_SYMBOL(hid_sensor_setup_trigger); | 200 | EXPORT_SYMBOL(hid_sensor_setup_trigger); |
201 | 201 | ||
202 | #ifdef CONFIG_PM | 202 | static int __maybe_unused hid_sensor_suspend(struct device *dev) |
203 | static int hid_sensor_suspend(struct device *dev) | ||
204 | { | 203 | { |
205 | struct platform_device *pdev = to_platform_device(dev); | 204 | struct platform_device *pdev = to_platform_device(dev); |
206 | struct iio_dev *indio_dev = platform_get_drvdata(pdev); | 205 | struct iio_dev *indio_dev = platform_get_drvdata(pdev); |
@@ -209,7 +208,7 @@ static int hid_sensor_suspend(struct device *dev) | |||
209 | return _hid_sensor_power_state(attrb, false); | 208 | return _hid_sensor_power_state(attrb, false); |
210 | } | 209 | } |
211 | 210 | ||
212 | static int hid_sensor_resume(struct device *dev) | 211 | static int __maybe_unused hid_sensor_resume(struct device *dev) |
213 | { | 212 | { |
214 | struct platform_device *pdev = to_platform_device(dev); | 213 | struct platform_device *pdev = to_platform_device(dev); |
215 | struct iio_dev *indio_dev = platform_get_drvdata(pdev); | 214 | struct iio_dev *indio_dev = platform_get_drvdata(pdev); |
@@ -218,7 +217,7 @@ static int hid_sensor_resume(struct device *dev) | |||
218 | return 0; | 217 | return 0; |
219 | } | 218 | } |
220 | 219 | ||
221 | static int hid_sensor_runtime_resume(struct device *dev) | 220 | static int __maybe_unused hid_sensor_runtime_resume(struct device *dev) |
222 | { | 221 | { |
223 | struct platform_device *pdev = to_platform_device(dev); | 222 | struct platform_device *pdev = to_platform_device(dev); |
224 | struct iio_dev *indio_dev = platform_get_drvdata(pdev); | 223 | struct iio_dev *indio_dev = platform_get_drvdata(pdev); |
@@ -226,8 +225,6 @@ static int hid_sensor_runtime_resume(struct device *dev) | |||
226 | return _hid_sensor_power_state(attrb, true); | 225 | return _hid_sensor_power_state(attrb, true); |
227 | } | 226 | } |
228 | 227 | ||
229 | #endif | ||
230 | |||
231 | const struct dev_pm_ops hid_sensor_pm_ops = { | 228 | const struct dev_pm_ops hid_sensor_pm_ops = { |
232 | SET_SYSTEM_SLEEP_PM_OPS(hid_sensor_suspend, hid_sensor_resume) | 229 | SET_SYSTEM_SLEEP_PM_OPS(hid_sensor_suspend, hid_sensor_resume) |
233 | SET_RUNTIME_PM_OPS(hid_sensor_suspend, | 230 | SET_RUNTIME_PM_OPS(hid_sensor_suspend, |