summaryrefslogtreecommitdiff
path: root/drivers/iio/light/st_uvis25_core.c
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2022-08-07 19:56:18 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-09-21 18:42:57 +0100
commit3259b99e0afc9b7b245b5aaa121a94a2b5d637ce (patch)
tree757691a0cc0fdfbec0202954e662ca6db714a667 /drivers/iio/light/st_uvis25_core.c
parent66991b106a2c182c1b499d45d3025318d8774bd6 (diff)
iio: light: st_uvis25: Use EXPORT_NS_SIMPLE_DEV_PM_OPS()
Using this new macro removes the need to mark the callbacks __maybe_unused. One slightly complexity in this case is that the export will exist if CONFIG_PM is set, but only be used if CONFIG_PM_SLEEP is also set. This is harmless. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> Link: https://lore.kernel.org/r/20220807185618.1038812-7-jic23@kernel.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/light/st_uvis25_core.c')
-rw-r--r--drivers/iio/light/st_uvis25_core.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/iio/light/st_uvis25_core.c b/drivers/iio/light/st_uvis25_core.c
index 3d4cc1180b6a..c737d3e193ae 100644
--- a/drivers/iio/light/st_uvis25_core.c
+++ b/drivers/iio/light/st_uvis25_core.c
@@ -325,7 +325,7 @@ int st_uvis25_probe(struct device *dev, int irq, struct regmap *regmap)
}
EXPORT_SYMBOL_NS(st_uvis25_probe, IIO_UVIS25);
-static int __maybe_unused st_uvis25_suspend(struct device *dev)
+static int st_uvis25_suspend(struct device *dev)
{
struct iio_dev *iio_dev = dev_get_drvdata(dev);
struct st_uvis25_hw *hw = iio_priv(iio_dev);
@@ -334,7 +334,7 @@ static int __maybe_unused st_uvis25_suspend(struct device *dev)
ST_UVIS25_REG_ODR_MASK, 0);
}
-static int __maybe_unused st_uvis25_resume(struct device *dev)
+static int st_uvis25_resume(struct device *dev)
{
struct iio_dev *iio_dev = dev_get_drvdata(dev);
struct st_uvis25_hw *hw = iio_priv(iio_dev);
@@ -346,10 +346,7 @@ static int __maybe_unused st_uvis25_resume(struct device *dev)
return 0;
}
-const struct dev_pm_ops st_uvis25_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(st_uvis25_suspend, st_uvis25_resume)
-};
-EXPORT_SYMBOL_NS(st_uvis25_pm_ops, IIO_UVIS25);
+EXPORT_NS_SIMPLE_DEV_PM_OPS(st_uvis25_pm_ops, st_uvis25_suspend, st_uvis25_resume, IIO_UVIS25);
MODULE_AUTHOR("Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>");
MODULE_DESCRIPTION("STMicroelectronics uvis25 sensor driver");