[PATCH v2] arm: orion5x: use string choices helper

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Mon Jun 16 19:22:02 PDT 2025


It updates format to keep "online/offline".

-	sprintf(buf, "%s\n",     ...? "online" : "offline");
+	sprintf(buf, "%sline\n", ..., str_on_off(...));
	                ^^^^

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
Reviewed-by: Andrew Lunn <andrew at lunn.ch>
---
v1 -> v2
	- add git-comment
	- add Reviewed-by

 arch/arm/mach-orion5x/ts78xx-setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-orion5x/ts78xx-setup.c b/arch/arm/mach-orion5x/ts78xx-setup.c
index af810e7ccd79..c250703e696d 100644
--- a/arch/arm/mach-orion5x/ts78xx-setup.c
+++ b/arch/arm/mach-orion5x/ts78xx-setup.c
@@ -460,7 +460,7 @@ static ssize_t ts78xx_fpga_show(struct kobject *kobj,
 	if (ts78xx_fpga.state < 0)
 		return sprintf(buf, "borked\n");
 
-	return sprintf(buf, "%s\n", (ts78xx_fpga.state) ? "online" : "offline");
+	return sprintf(buf, "%sline\n", str_on_off(ts78xx_fpga.state));
 }
 
 static ssize_t ts78xx_fpga_store(struct kobject *kobj,
-- 
2.43.0




More information about the linux-arm-kernel mailing list