diff mbox series

[4/6] drm/bridge: samsung-dsim: Switch to RUNTIME_PM_OPS()

Message ID 20240626230704.708234-4-festevam@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/6] drm/bridge: imx8mp-hdmi-tx: Switch to SYSTEM_SLEEP_PM_OPS() | expand

Commit Message

Fabio Estevam June 26, 2024, 11:07 p.m. UTC
From: Fabio Estevam <festevam@denx.de>

Replace SET_RUNTIME_PM_OPS with its modern RUNTIME_PM_OPS() alternative.

The combined usage of pm_ptr() and RUNTIME_PM_OPS()
allows the compiler to evaluate if the runtime suspend/resume() functions
are used at build time or are simply dead code.

This allows removing the __maybe_unused notation from the runtime
suspend/resume() functions.

Signed-off-by: Fabio Estevam <festevam@denx.de>
---
 drivers/gpu/drm/bridge/samsung-dsim.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Neil Armstrong Sept. 13, 2024, 7:49 a.m. UTC | #1
On 27/06/2024 01:07, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> Replace SET_RUNTIME_PM_OPS with its modern RUNTIME_PM_OPS() alternative.
> 
> The combined usage of pm_ptr() and RUNTIME_PM_OPS()
> allows the compiler to evaluate if the runtime suspend/resume() functions
> are used at build time or are simply dead code.
> 
> This allows removing the __maybe_unused notation from the runtime
> suspend/resume() functions.
> 
> Signed-off-by: Fabio Estevam <festevam@denx.de>
> ---
>   drivers/gpu/drm/bridge/samsung-dsim.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c
> index e7e53a9e42af..73ccf21ae446 100644
> --- a/drivers/gpu/drm/bridge/samsung-dsim.c
> +++ b/drivers/gpu/drm/bridge/samsung-dsim.c
> @@ -2043,7 +2043,7 @@ void samsung_dsim_remove(struct platform_device *pdev)
>   }
>   EXPORT_SYMBOL_GPL(samsung_dsim_remove);
>   
> -static int __maybe_unused samsung_dsim_suspend(struct device *dev)
> +static int samsung_dsim_suspend(struct device *dev)
>   {
>   	struct samsung_dsim *dsi = dev_get_drvdata(dev);
>   	const struct samsung_dsim_driver_data *driver_data = dsi->driver_data;
> @@ -2073,7 +2073,7 @@ static int __maybe_unused samsung_dsim_suspend(struct device *dev)
>   	return 0;
>   }
>   
> -static int __maybe_unused samsung_dsim_resume(struct device *dev)
> +static int samsung_dsim_resume(struct device *dev)
>   {
>   	struct samsung_dsim *dsi = dev_get_drvdata(dev);
>   	const struct samsung_dsim_driver_data *driver_data = dsi->driver_data;
> @@ -2108,7 +2108,7 @@ static int __maybe_unused samsung_dsim_resume(struct device *dev)
>   }
>   
>   const struct dev_pm_ops samsung_dsim_pm_ops = {
> -	SET_RUNTIME_PM_OPS(samsung_dsim_suspend, samsung_dsim_resume, NULL)
> +	RUNTIME_PM_OPS(samsung_dsim_suspend, samsung_dsim_resume, NULL)
>   	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
>   				pm_runtime_force_resume)
>   };
> @@ -2142,7 +2142,7 @@ static struct platform_driver samsung_dsim_driver = {
>   	.remove_new = samsung_dsim_remove,
>   	.driver = {
>   		   .name = "samsung-dsim",
> -		   .pm = &samsung_dsim_pm_ops,
> +		   .pm = pm_ptr(&samsung_dsim_pm_ops),
>   		   .of_match_table = samsung_dsim_of_match,
>   	},
>   };

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge/samsung-dsim.c
index e7e53a9e42af..73ccf21ae446 100644
--- a/drivers/gpu/drm/bridge/samsung-dsim.c
+++ b/drivers/gpu/drm/bridge/samsung-dsim.c
@@ -2043,7 +2043,7 @@  void samsung_dsim_remove(struct platform_device *pdev)
 }
 EXPORT_SYMBOL_GPL(samsung_dsim_remove);
 
-static int __maybe_unused samsung_dsim_suspend(struct device *dev)
+static int samsung_dsim_suspend(struct device *dev)
 {
 	struct samsung_dsim *dsi = dev_get_drvdata(dev);
 	const struct samsung_dsim_driver_data *driver_data = dsi->driver_data;
@@ -2073,7 +2073,7 @@  static int __maybe_unused samsung_dsim_suspend(struct device *dev)
 	return 0;
 }
 
-static int __maybe_unused samsung_dsim_resume(struct device *dev)
+static int samsung_dsim_resume(struct device *dev)
 {
 	struct samsung_dsim *dsi = dev_get_drvdata(dev);
 	const struct samsung_dsim_driver_data *driver_data = dsi->driver_data;
@@ -2108,7 +2108,7 @@  static int __maybe_unused samsung_dsim_resume(struct device *dev)
 }
 
 const struct dev_pm_ops samsung_dsim_pm_ops = {
-	SET_RUNTIME_PM_OPS(samsung_dsim_suspend, samsung_dsim_resume, NULL)
+	RUNTIME_PM_OPS(samsung_dsim_suspend, samsung_dsim_resume, NULL)
 	SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
 				pm_runtime_force_resume)
 };
@@ -2142,7 +2142,7 @@  static struct platform_driver samsung_dsim_driver = {
 	.remove_new = samsung_dsim_remove,
 	.driver = {
 		   .name = "samsung-dsim",
-		   .pm = &samsung_dsim_pm_ops,
+		   .pm = pm_ptr(&samsung_dsim_pm_ops),
 		   .of_match_table = samsung_dsim_of_match,
 	},
 };