* pmdomain: starfive: Use str_on_off() helper in jh7110_pmu_set_state()
@ 2025-05-29 2:20 shao.mingyin
2025-05-29 2:41 ` 回复: " Changhuang Liang
2025-05-29 6:40 ` Krzysztof Kozlowski
0 siblings, 2 replies; 3+ messages in thread
From: shao.mingyin @ 2025-05-29 2:20 UTC (permalink / raw)
To: walker.chen
Cc: changhuang.liang, ulf.hansson, linux-pm, linux-kernel,
yang.yang29, xu.xin16, yang.tao172, ye.xingchen
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* 回复: pmdomain: starfive: Use str_on_off() helper in jh7110_pmu_set_state()
2025-05-29 2:20 pmdomain: starfive: Use str_on_off() helper in jh7110_pmu_set_state() shao.mingyin
@ 2025-05-29 2:41 ` Changhuang Liang
2025-05-29 6:40 ` Krzysztof Kozlowski
1 sibling, 0 replies; 3+ messages in thread
From: Changhuang Liang @ 2025-05-29 2:41 UTC (permalink / raw)
To: shao.mingyin@zte.com.cn, Walker Chen
Cc: ulf.hansson@linaro.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org, yang.yang29@zte.com.cn,
xu.xin16@zte.com.cn, yang.tao172@zte.com.cn,
ye.xingchen@zte.com.cn
Hi, Mingyin
Thanks for your patch.
> 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;
> }
>
Would you mind adjusting this part and send V2?
In jh71xx-pmu.c jh71xx_pmu_set_state()
if (is_on == on) {
dev_dbg(pmu->dev, "pm domain [%s] is already %sable status.\n",
pmd->genpd.name, on ? "en" : "dis");
return 0;
}
====>
if (is_on == on) {
dev_dbg(pmu->dev, "pm domain [%s] is already %s status.\n",
pmd->genpd.name, str_enable_disable(on));
return 0;
}
Best Regards,
Changhuang
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: pmdomain: starfive: Use str_on_off() helper in jh7110_pmu_set_state()
2025-05-29 2:20 pmdomain: starfive: Use str_on_off() helper in jh7110_pmu_set_state() shao.mingyin
2025-05-29 2:41 ` 回复: " Changhuang Liang
@ 2025-05-29 6:40 ` Krzysztof Kozlowski
1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2025-05-29 6:40 UTC (permalink / raw)
To: shao.mingyin, walker.chen
Cc: changhuang.liang, ulf.hansson, linux-pm, linux-kernel,
yang.yang29, xu.xin16, yang.tao172, ye.xingchen
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-29 6:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-29 2:20 pmdomain: starfive: Use str_on_off() helper in jh7110_pmu_set_state() shao.mingyin
2025-05-29 2:41 ` 回复: " Changhuang Liang
2025-05-29 6:40 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox