提交 2583f5e8 编写于 作者: J Jonathan Cameron

iio: adc: imx8qxp: Switch to DEFINE_RUNTIME_DEV_PM_OPS and pm_ptr()

Switching to these newer macros allows the compiler to remove
the unused functions and struct dev_pm_ops if !CONFIG_PM without
the need to mark anything __maybe_unused.
Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Cai Huoqing <cai.huoqing@linux.dev>
Reviewed-by: NHaibo Chen <haibo.chen@nxp.com>
Reviewed-by: NPaul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220621202719.13644-28-jic23@kernel.org
上级 a79163d1
...@@ -417,7 +417,7 @@ static int imx8qxp_adc_remove(struct platform_device *pdev) ...@@ -417,7 +417,7 @@ static int imx8qxp_adc_remove(struct platform_device *pdev)
return 0; return 0;
} }
static __maybe_unused int imx8qxp_adc_runtime_suspend(struct device *dev) static int imx8qxp_adc_runtime_suspend(struct device *dev)
{ {
struct iio_dev *indio_dev = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct imx8qxp_adc *adc = iio_priv(indio_dev); struct imx8qxp_adc *adc = iio_priv(indio_dev);
...@@ -431,7 +431,7 @@ static __maybe_unused int imx8qxp_adc_runtime_suspend(struct device *dev) ...@@ -431,7 +431,7 @@ static __maybe_unused int imx8qxp_adc_runtime_suspend(struct device *dev)
return 0; return 0;
} }
static __maybe_unused int imx8qxp_adc_runtime_resume(struct device *dev) static int imx8qxp_adc_runtime_resume(struct device *dev)
{ {
struct iio_dev *indio_dev = dev_get_drvdata(dev); struct iio_dev *indio_dev = dev_get_drvdata(dev);
struct imx8qxp_adc *adc = iio_priv(indio_dev); struct imx8qxp_adc *adc = iio_priv(indio_dev);
...@@ -468,10 +468,9 @@ static __maybe_unused int imx8qxp_adc_runtime_resume(struct device *dev) ...@@ -468,10 +468,9 @@ static __maybe_unused int imx8qxp_adc_runtime_resume(struct device *dev)
return ret; return ret;
} }
static const struct dev_pm_ops imx8qxp_adc_pm_ops = { static DEFINE_RUNTIME_DEV_PM_OPS(imx8qxp_adc_pm_ops,
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) imx8qxp_adc_runtime_suspend,
SET_RUNTIME_PM_OPS(imx8qxp_adc_runtime_suspend, imx8qxp_adc_runtime_resume, NULL) imx8qxp_adc_runtime_resume, NULL);
};
static const struct of_device_id imx8qxp_adc_match[] = { static const struct of_device_id imx8qxp_adc_match[] = {
{ .compatible = "nxp,imx8qxp-adc", }, { .compatible = "nxp,imx8qxp-adc", },
...@@ -485,7 +484,7 @@ static struct platform_driver imx8qxp_adc_driver = { ...@@ -485,7 +484,7 @@ static struct platform_driver imx8qxp_adc_driver = {
.driver = { .driver = {
.name = ADC_DRIVER_NAME, .name = ADC_DRIVER_NAME,
.of_match_table = imx8qxp_adc_match, .of_match_table = imx8qxp_adc_match,
.pm = &imx8qxp_adc_pm_ops, .pm = pm_ptr(&imx8qxp_adc_pm_ops),
}, },
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册