summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2022-06-21 22:26:47 +0200
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-07-18 19:48:17 +0200
commitcdb77810590595c5341b5e8b15e4ce28f1eadced (patch)
tree931e193fdf55c935d0e59ad7f4ddc5e484aa0953
parentiio: adc: at91-sam5d2: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() (diff)
downloadlinux-cdb77810590595c5341b5e8b15e4ce28f1eadced.tar.xz
linux-cdb77810590595c5341b5e8b15e4ce28f1eadced.zip
iio: adc: imx7d_adc: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
In this case we only gain the ability to have the compiler drop the struct dev_pm_ops because the callbacks are called from paths other than suspend and resume. In general the purpose of this new macro is to allow automated removal of the callbacks as well, but that doesn't apply here. Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Cc: Haibo Chen <haibo.chen@nxp.com> Reviewed-by: Haibo Chen <haibo.chen@nxp.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-5-jic23@kernel.org
-rw-r--r--drivers/iio/adc/imx7d_adc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/iio/adc/imx7d_adc.c b/drivers/iio/adc/imx7d_adc.c
index 119217af2bde..86caff1d006b 100644
--- a/drivers/iio/adc/imx7d_adc.c
+++ b/drivers/iio/adc/imx7d_adc.c
@@ -540,14 +540,15 @@ static int imx7d_adc_probe(struct platform_device *pdev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(imx7d_adc_pm_ops, imx7d_adc_disable, imx7d_adc_enable);
+static DEFINE_SIMPLE_DEV_PM_OPS(imx7d_adc_pm_ops, imx7d_adc_disable,
+ imx7d_adc_enable);
static struct platform_driver imx7d_adc_driver = {
.probe = imx7d_adc_probe,
.driver = {
.name = "imx7d_adc",
.of_match_table = imx7d_adc_match,
- .pm = &imx7d_adc_pm_ops,
+ .pm = pm_sleep_ptr(&imx7d_adc_pm_ops),
},
};