summaryrefslogtreecommitdiff
path: root/drivers/iio
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2022-06-21 21:26:49 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-07-18 18:48:17 +0100
commit7ff1d28cc5f4693c10e5a76d37db04c0cddc3835 (patch)
treedc8127fab12efae1fb8c4aae03bf1dce19e7de3d /drivers/iio
parent507379983b105d045e798fbdfe871e824fb6c370 (diff)
iio: adc: mt6577_auxadc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
Using these newer macros allows the compiler to remove the unused structure and functions when !CONFIG_PM_SLEEP + removes the need to mark pm functions __maybe_unused. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Zhiyong Tao <zhiyong.tao@mediatek.com> Cc: Hui Liu <hui.liu@mediatek.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-7-jic23@kernel.org
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/adc/mt6577_auxadc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/iio/adc/mt6577_auxadc.c b/drivers/iio/adc/mt6577_auxadc.c
index e78c96a185db..0e134777bdd2 100644
--- a/drivers/iio/adc/mt6577_auxadc.c
+++ b/drivers/iio/adc/mt6577_auxadc.c
@@ -215,7 +215,7 @@ static const struct iio_info mt6577_auxadc_info = {
.read_raw = &mt6577_auxadc_read_raw,
};
-static int __maybe_unused mt6577_auxadc_resume(struct device *dev)
+static int mt6577_auxadc_resume(struct device *dev)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
@@ -234,7 +234,7 @@ static int __maybe_unused mt6577_auxadc_resume(struct device *dev)
return 0;
}
-static int __maybe_unused mt6577_auxadc_suspend(struct device *dev)
+static int mt6577_auxadc_suspend(struct device *dev)
{
struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct mt6577_auxadc_device *adc_dev = iio_priv(indio_dev);
@@ -330,9 +330,9 @@ static int mt6577_auxadc_remove(struct platform_device *pdev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(mt6577_auxadc_pm_ops,
- mt6577_auxadc_suspend,
- mt6577_auxadc_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(mt6577_auxadc_pm_ops,
+ mt6577_auxadc_suspend,
+ mt6577_auxadc_resume);
static const struct of_device_id mt6577_auxadc_of_match[] = {
{ .compatible = "mediatek,mt2701-auxadc", .data = &mt8173_compat },
@@ -349,7 +349,7 @@ static struct platform_driver mt6577_auxadc_driver = {
.driver = {
.name = "mt6577-auxadc",
.of_match_table = mt6577_auxadc_of_match,
- .pm = &mt6577_auxadc_pm_ops,
+ .pm = pm_sleep_ptr(&mt6577_auxadc_pm_ops),
},
.probe = mt6577_auxadc_probe,
.remove = mt6577_auxadc_remove,