linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thermal: rcar_gen3: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
@ 2025-07-09 19:04 Geert Uytterhoeven
  2025-07-10 13:01 ` Niklas Söderlund
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2025-07-09 19:04 UTC (permalink / raw)
  To: Niklas Söderlund, Rafael J . Wysocki, Daniel Lezcano,
	Zhang Rui, Lukasz Luba
  Cc: linux-renesas-soc, linux-pm, Geert Uytterhoeven

Convert the Renesas R-Car Gen3 thermal driver from SIMPLE_DEV_PM_OPS()
to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr().  This lets us drop the
__maybe_unused annotation from its resume callback, and reduces kernel
size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/thermal/renesas/rcar_gen3_thermal.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/thermal/renesas/rcar_gen3_thermal.c b/drivers/thermal/renesas/rcar_gen3_thermal.c
index 24a702ee4c1fb83d..b54338bbc4c78a1d 100644
--- a/drivers/thermal/renesas/rcar_gen3_thermal.c
+++ b/drivers/thermal/renesas/rcar_gen3_thermal.c
@@ -570,7 +570,7 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
 	return ret;
 }
 
-static int __maybe_unused rcar_gen3_thermal_resume(struct device *dev)
+static int rcar_gen3_thermal_resume(struct device *dev)
 {
 	struct rcar_gen3_thermal_priv *priv = dev_get_drvdata(dev);
 	unsigned int i;
@@ -584,13 +584,13 @@ static int __maybe_unused rcar_gen3_thermal_resume(struct device *dev)
 	return 0;
 }
 
-static SIMPLE_DEV_PM_OPS(rcar_gen3_thermal_pm_ops, NULL,
-			 rcar_gen3_thermal_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(rcar_gen3_thermal_pm_ops, NULL,
+				rcar_gen3_thermal_resume);
 
 static struct platform_driver rcar_gen3_thermal_driver = {
 	.driver	= {
 		.name	= "rcar_gen3_thermal",
-		.pm = &rcar_gen3_thermal_pm_ops,
+		.pm = pm_sleep_ptr(&rcar_gen3_thermal_pm_ops),
 		.of_match_table = rcar_gen3_thermal_dt_ids,
 	},
 	.probe		= rcar_gen3_thermal_probe,
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] thermal: rcar_gen3: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
  2025-07-09 19:04 [PATCH] thermal: rcar_gen3: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Geert Uytterhoeven
@ 2025-07-10 13:01 ` Niklas Söderlund
  0 siblings, 0 replies; 2+ messages in thread
From: Niklas Söderlund @ 2025-07-10 13:01 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rafael J . Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
	linux-renesas-soc, linux-pm

Hi Geert,

Thanks for your patch.

On 2025-07-09 21:04:58 +0200, Geert Uytterhoeven wrote:
> Convert the Renesas R-Car Gen3 thermal driver from SIMPLE_DEV_PM_OPS()
> to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr().  This lets us drop the
> __maybe_unused annotation from its resume callback, and reduces kernel
> size in case CONFIG_PM or CONFIG_PM_SLEEP is disabled.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> ---
>  drivers/thermal/renesas/rcar_gen3_thermal.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/thermal/renesas/rcar_gen3_thermal.c b/drivers/thermal/renesas/rcar_gen3_thermal.c
> index 24a702ee4c1fb83d..b54338bbc4c78a1d 100644
> --- a/drivers/thermal/renesas/rcar_gen3_thermal.c
> +++ b/drivers/thermal/renesas/rcar_gen3_thermal.c
> @@ -570,7 +570,7 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
>  	return ret;
>  }
>  
> -static int __maybe_unused rcar_gen3_thermal_resume(struct device *dev)
> +static int rcar_gen3_thermal_resume(struct device *dev)
>  {
>  	struct rcar_gen3_thermal_priv *priv = dev_get_drvdata(dev);
>  	unsigned int i;
> @@ -584,13 +584,13 @@ static int __maybe_unused rcar_gen3_thermal_resume(struct device *dev)
>  	return 0;
>  }
>  
> -static SIMPLE_DEV_PM_OPS(rcar_gen3_thermal_pm_ops, NULL,
> -			 rcar_gen3_thermal_resume);
> +static DEFINE_SIMPLE_DEV_PM_OPS(rcar_gen3_thermal_pm_ops, NULL,
> +				rcar_gen3_thermal_resume);
>  
>  static struct platform_driver rcar_gen3_thermal_driver = {
>  	.driver	= {
>  		.name	= "rcar_gen3_thermal",
> -		.pm = &rcar_gen3_thermal_pm_ops,
> +		.pm = pm_sleep_ptr(&rcar_gen3_thermal_pm_ops),
>  		.of_match_table = rcar_gen3_thermal_dt_ids,
>  	},
>  	.probe		= rcar_gen3_thermal_probe,
> -- 
> 2.43.0
> 

-- 
Kind Regards,
Niklas Söderlund

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-10 13:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-09 19:04 [PATCH] thermal: rcar_gen3: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Geert Uytterhoeven
2025-07-10 13:01 ` Niklas Söderlund

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).