diff mbox series

[1/6] drm/bridge: imx8mp-hdmi-tx: Switch to SYSTEM_SLEEP_PM_OPS()

Message ID 20240626230704.708234-1-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:06 p.m. UTC
From: Fabio Estevam <festevam@denx.de>

Replace SET_SYSTEM_SLEEP_PM_OPS with its modern SYSTEM_SLEEP_PM_OPS()
alternative.

The combined usage of pm_ptr() and SYSTEM_SLEEP_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/imx/imx8mp-hdmi-tx.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Fabio Estevam Aug. 28, 2024, 8:20 p.m. UTC | #1
A gentle ping on this series.

Thanks

On Wed, Jun 26, 2024 at 8:07 PM Fabio Estevam <festevam@gmail.com> wrote:
>
> From: Fabio Estevam <festevam@denx.de>
>
> Replace SET_SYSTEM_SLEEP_PM_OPS with its modern SYSTEM_SLEEP_PM_OPS()
> alternative.
>
> The combined usage of pm_ptr() and SYSTEM_SLEEP_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/imx/imx8mp-hdmi-tx.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
> index 13bc570c5473..4a3a8a3ce250 100644
> --- a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
> +++ b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
> @@ -111,12 +111,12 @@ static void imx8mp_dw_hdmi_remove(struct platform_device *pdev)
>         dw_hdmi_remove(hdmi->dw_hdmi);
>  }
>
> -static int __maybe_unused imx8mp_dw_hdmi_pm_suspend(struct device *dev)
> +static int imx8mp_dw_hdmi_pm_suspend(struct device *dev)
>  {
>         return 0;
>  }
>
> -static int __maybe_unused imx8mp_dw_hdmi_pm_resume(struct device *dev)
> +static int imx8mp_dw_hdmi_pm_resume(struct device *dev)
>  {
>         struct imx8mp_hdmi *hdmi = dev_get_drvdata(dev);
>
> @@ -126,8 +126,7 @@ static int __maybe_unused imx8mp_dw_hdmi_pm_resume(struct device *dev)
>  }
>
>  static const struct dev_pm_ops imx8mp_dw_hdmi_pm_ops = {
> -       SET_SYSTEM_SLEEP_PM_OPS(imx8mp_dw_hdmi_pm_suspend,
> -                               imx8mp_dw_hdmi_pm_resume)
> +       SYSTEM_SLEEP_PM_OPS(imx8mp_dw_hdmi_pm_suspend, imx8mp_dw_hdmi_pm_resume)
>  };
>
>  static const struct of_device_id imx8mp_dw_hdmi_of_table[] = {
> @@ -142,7 +141,7 @@ static struct platform_driver imx8mp_dw_hdmi_platform_driver = {
>         .driver         = {
>                 .name   = "imx8mp-dw-hdmi-tx",
>                 .of_match_table = imx8mp_dw_hdmi_of_table,
> -               .pm = &imx8mp_dw_hdmi_pm_ops,
> +               .pm = pm_ptr(&imx8mp_dw_hdmi_pm_ops),
>         },
>  };
>
> --
> 2.34.1
>
Neil Armstrong Sept. 13, 2024, 7:58 a.m. UTC | #2
On 27/06/2024 01:06, Fabio Estevam wrote:
> From: Fabio Estevam <festevam@denx.de>
> 
> Replace SET_SYSTEM_SLEEP_PM_OPS with its modern SYSTEM_SLEEP_PM_OPS()
> alternative.
> 
> The combined usage of pm_ptr() and SYSTEM_SLEEP_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/imx/imx8mp-hdmi-tx.c | 9 ++++-----
>   1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
> index 13bc570c5473..4a3a8a3ce250 100644
> --- a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
> +++ b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
> @@ -111,12 +111,12 @@ static void imx8mp_dw_hdmi_remove(struct platform_device *pdev)
>   	dw_hdmi_remove(hdmi->dw_hdmi);
>   }
>   
> -static int __maybe_unused imx8mp_dw_hdmi_pm_suspend(struct device *dev)
> +static int imx8mp_dw_hdmi_pm_suspend(struct device *dev)
>   {
>   	return 0;
>   }
>   
> -static int __maybe_unused imx8mp_dw_hdmi_pm_resume(struct device *dev)
> +static int imx8mp_dw_hdmi_pm_resume(struct device *dev)
>   {
>   	struct imx8mp_hdmi *hdmi = dev_get_drvdata(dev);
>   
> @@ -126,8 +126,7 @@ static int __maybe_unused imx8mp_dw_hdmi_pm_resume(struct device *dev)
>   }
>   
>   static const struct dev_pm_ops imx8mp_dw_hdmi_pm_ops = {
> -	SET_SYSTEM_SLEEP_PM_OPS(imx8mp_dw_hdmi_pm_suspend,
> -				imx8mp_dw_hdmi_pm_resume)
> +	SYSTEM_SLEEP_PM_OPS(imx8mp_dw_hdmi_pm_suspend, imx8mp_dw_hdmi_pm_resume)
>   };
>   
>   static const struct of_device_id imx8mp_dw_hdmi_of_table[] = {
> @@ -142,7 +141,7 @@ static struct platform_driver imx8mp_dw_hdmi_platform_driver = {
>   	.driver		= {
>   		.name	= "imx8mp-dw-hdmi-tx",
>   		.of_match_table = imx8mp_dw_hdmi_of_table,
> -		.pm = &imx8mp_dw_hdmi_pm_ops,
> +		.pm = pm_ptr(&imx8mp_dw_hdmi_pm_ops),
>   	},
>   };
>   

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Neil Armstrong Sept. 13, 2024, 8:12 a.m. UTC | #3
Hi,

On Wed, 26 Jun 2024 20:06:59 -0300, Fabio Estevam wrote:
> Replace SET_SYSTEM_SLEEP_PM_OPS with its modern SYSTEM_SLEEP_PM_OPS()
> alternative.
> 
> The combined usage of pm_ptr() and SYSTEM_SLEEP_PM_OPS()
> allows the compiler to evaluate if the runtime suspend/resume() functions
> are used at build time or are simply dead code.
> 
> [...]

Thanks, Applied to https://gitlab.freedesktop.org/drm/misc/kernel.git (drm-misc-next)

[1/6] drm/bridge: imx8mp-hdmi-tx: Switch to SYSTEM_SLEEP_PM_OPS()
      https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/017703370638c07cd6affe661118f697ee113881
[2/6] drm/bridge: imx8qm-ldb: Switch to RUNTIME_PM_OPS()
      https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/02b16c5236e1823047f001b9496e59458c9a7482
[3/6] drm/bridge: imx8qxp-pixel-combiner: Switch to RUNTIME_PM_OPS()
      https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/be227772f7e957f98c3c828459b1221cae84de2e
[4/6] drm/bridge: samsung-dsim: Switch to RUNTIME_PM_OPS()
      https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/5de3c40a1dc503bf915bbc048aa8f5efb369650c
[5/6] drm/bridge: dw-hdmi-cec: Switch to SYSTEM_SLEEP_PM_OPS()
      https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/46fe7763c65674be67828cdbe3a72d6d9b8f8aa7
[6/6] drm/bridge: imx8qxp-ldb: Switch to RUNTIME_PM_OPS()
      https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/8fdd9cb4f8c03a943090ef55ffb552e05c6defc6
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
index 13bc570c5473..4a3a8a3ce250 100644
--- a/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
+++ b/drivers/gpu/drm/bridge/imx/imx8mp-hdmi-tx.c
@@ -111,12 +111,12 @@  static void imx8mp_dw_hdmi_remove(struct platform_device *pdev)
 	dw_hdmi_remove(hdmi->dw_hdmi);
 }
 
-static int __maybe_unused imx8mp_dw_hdmi_pm_suspend(struct device *dev)
+static int imx8mp_dw_hdmi_pm_suspend(struct device *dev)
 {
 	return 0;
 }
 
-static int __maybe_unused imx8mp_dw_hdmi_pm_resume(struct device *dev)
+static int imx8mp_dw_hdmi_pm_resume(struct device *dev)
 {
 	struct imx8mp_hdmi *hdmi = dev_get_drvdata(dev);
 
@@ -126,8 +126,7 @@  static int __maybe_unused imx8mp_dw_hdmi_pm_resume(struct device *dev)
 }
 
 static const struct dev_pm_ops imx8mp_dw_hdmi_pm_ops = {
-	SET_SYSTEM_SLEEP_PM_OPS(imx8mp_dw_hdmi_pm_suspend,
-				imx8mp_dw_hdmi_pm_resume)
+	SYSTEM_SLEEP_PM_OPS(imx8mp_dw_hdmi_pm_suspend, imx8mp_dw_hdmi_pm_resume)
 };
 
 static const struct of_device_id imx8mp_dw_hdmi_of_table[] = {
@@ -142,7 +141,7 @@  static struct platform_driver imx8mp_dw_hdmi_platform_driver = {
 	.driver		= {
 		.name	= "imx8mp-dw-hdmi-tx",
 		.of_match_table = imx8mp_dw_hdmi_of_table,
-		.pm = &imx8mp_dw_hdmi_pm_ops,
+		.pm = pm_ptr(&imx8mp_dw_hdmi_pm_ops),
 	},
 };