summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAlain Volmat <alain.volmat@foss.st.com>2026-01-06 14:34:29 +0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2026-03-11 03:05:32 +0300
commit9ab2bd7760a9edc23dfef71bb94092359ce94024 (patch)
tree2e394d59d157528f3a2838c9f06458461f03fb6a /drivers
parent0001c706ee98738613cc8f6dcd139766230a9e01 (diff)
downloadlinux-9ab2bd7760a9edc23dfef71bb94092359ce94024.tar.xz
media: stm32: dcmi: Switch from __maybe_unused to pm_ptr()
Letting the compiler remove these functions when the kernel is built without CONFIG_PM_SLEEP support is simpler and less heavier for builds than the use of __maybe_unused attributes. Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/platform/st/stm32/stm32-dcmi.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/media/platform/st/stm32/stm32-dcmi.c b/drivers/media/platform/st/stm32/stm32-dcmi.c
index 13762861b769..619b0d981211 100644
--- a/drivers/media/platform/st/stm32/stm32-dcmi.c
+++ b/drivers/media/platform/st/stm32/stm32-dcmi.c
@@ -2092,7 +2092,7 @@ static void dcmi_remove(struct platform_device *pdev)
dma_release_channel(dcmi->dma_chan);
}
-static __maybe_unused int dcmi_runtime_suspend(struct device *dev)
+static int dcmi_runtime_suspend(struct device *dev)
{
struct stm32_dcmi *dcmi = dev_get_drvdata(dev);
@@ -2101,7 +2101,7 @@ static __maybe_unused int dcmi_runtime_suspend(struct device *dev)
return 0;
}
-static __maybe_unused int dcmi_runtime_resume(struct device *dev)
+static int dcmi_runtime_resume(struct device *dev)
{
struct stm32_dcmi *dcmi = dev_get_drvdata(dev);
int ret;
@@ -2113,7 +2113,7 @@ static __maybe_unused int dcmi_runtime_resume(struct device *dev)
return ret;
}
-static __maybe_unused int dcmi_suspend(struct device *dev)
+static int dcmi_suspend(struct device *dev)
{
/* disable clock */
pm_runtime_force_suspend(dev);
@@ -2124,7 +2124,7 @@ static __maybe_unused int dcmi_suspend(struct device *dev)
return 0;
}
-static __maybe_unused int dcmi_resume(struct device *dev)
+static int dcmi_resume(struct device *dev)
{
/* restore pinctl default state */
pinctrl_pm_select_default_state(dev);
@@ -2136,9 +2136,8 @@ static __maybe_unused int dcmi_resume(struct device *dev)
}
static const struct dev_pm_ops dcmi_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(dcmi_suspend, dcmi_resume)
- SET_RUNTIME_PM_OPS(dcmi_runtime_suspend,
- dcmi_runtime_resume, NULL)
+ SYSTEM_SLEEP_PM_OPS(dcmi_suspend, dcmi_resume)
+ RUNTIME_PM_OPS(dcmi_runtime_suspend, dcmi_runtime_resume, NULL)
};
static struct platform_driver stm32_dcmi_driver = {
@@ -2147,7 +2146,7 @@ static struct platform_driver stm32_dcmi_driver = {
.driver = {
.name = DRV_NAME,
.of_match_table = of_match_ptr(stm32_dcmi_of_match),
- .pm = &dcmi_pm_ops,
+ .pm = pm_ptr(&dcmi_pm_ops),
},
};