pmdomain: rockchip: Use str_on_off() helper in rockchip_do_pmu_set_power_domain()

shao.mingyin@zte.com.cn posted 1 patch 6 months, 3 weeks ago
drivers/pmdomain/rockchip/pm-domains.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
pmdomain: rockchip: Use str_on_off() helper in rockchip_do_pmu_set_power_domain()
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/rockchip/pm-domains.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pmdomain/rockchip/pm-domains.c b/drivers/pmdomain/rockchip/pm-domains.c
index 4cce407bb1eb..0681c763f843 100644
--- a/drivers/pmdomain/rockchip/pm-domains.c
+++ b/drivers/pmdomain/rockchip/pm-domains.c
@@ -21,6 +21,7 @@
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 #include <linux/mfd/syscon.h>
+#include <linux/string_choices.h>
 #include <soc/rockchip/pm_domains.h>
 #include <soc/rockchip/rockchip_sip.h>
 #include <dt-bindings/power/px30-power.h>
@@ -595,7 +596,7 @@ static int rockchip_do_pmu_set_power_domain(struct rockchip_pm_domain *pd,
 					is_on == on, 0, 10000);
 	if (ret) {
 		dev_err(pmu->dev, "failed to set domain '%s' %s, val=%d\n",
-			genpd->name, on ? "on" : "off", is_on);
+			genpd->name, str_on_off(on), is_on);
 		return ret;
 	}

-- 
2.25.1
Re: pmdomain: rockchip: Use str_on_off() helper in rockchip_do_pmu_set_power_domain()
Posted by Krzysztof Kozlowski 6 months, 3 weeks ago
On 29/05/2025 04:16, 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>
> ---

This was already sent:

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

Also read the feedback there.


Best regards,
Krzysztof