pmdomain: starfive: Use str_on_off() helper in jh7110_pmu_set_state()

shao.mingyin@zte.com.cn posted 1 patch 6 months, 3 weeks ago
drivers/pmdomain/starfive/jh71xx-pmu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
pmdomain: starfive: Use str_on_off() helper in jh7110_pmu_set_state()
Posted by shao.mingyin@zte.com.cn 6 months, 3 weeks ago
From: Shao Mingyin <shao.mingyin@zte.com.cn>

Remove hard-coded strings by using the str_on_off() helper function.

Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
---
 drivers/pmdomain/starfive/jh71xx-pmu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pmdomain/starfive/jh71xx-pmu.c b/drivers/pmdomain/starfive/jh71xx-pmu.c
index 74720c09a6e3..30c29ac9391f 100644
--- a/drivers/pmdomain/starfive/jh71xx-pmu.c
+++ b/drivers/pmdomain/starfive/jh71xx-pmu.c
@@ -12,6 +12,7 @@
 #include <linux/of.h>
 #include <linux/platform_device.h>
 #include <linux/pm_domain.h>
+#include <linux/string_choices.h>
 #include <dt-bindings/power/starfive,jh7110-pmu.h>

 /* register offset */
@@ -155,7 +156,7 @@ static int jh7110_pmu_set_state(struct jh71xx_pmu_dev *pmd, u32 mask, bool on)

 	if (ret) {
 		dev_err(pmu->dev, "%s: failed to power %s\n",
-			pmd->genpd.name, on ? "on" : "off");
+			pmd->genpd.name, str_on_off(on));
 		return -ETIMEDOUT;
 	}

-- 
2.25.1
Re: pmdomain: starfive: Use str_on_off() helper in jh7110_pmu_set_state()
Posted by Krzysztof Kozlowski 6 months, 3 weeks ago
On 29/05/2025 04:20, shao.mingyin@zte.com.cn wrote:
> From: Shao Mingyin <shao.mingyin@zte.com.cn>
> 
> Remove hard-coded strings by using the str_on_off() helper function.
> 
> Signed-off-by: Shao Mingyin <shao.mingyin@zte.com.cn>
> ---
>  drivers/pmdomain/starfive/jh71xx-pmu.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
This was already sent:

https://lore.kernel.org/all/20250114203547.1013010-1-krzysztof.kozlowski@linaro.org/

Also read the feedback there.

Best regards,
Krzysztof