Skip to contentSkip to conversation

pinctrl: starfive: jhb100: use str_enable_disable()

PATCH In review Aryan Sinha 3 participants 3 messages Nov 4 – Nov 5

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: starfive: jhb100: use str_enable_disable()

Replace the open coded ternary in the jhb100_irq_set_wake() function with the helper from string_choices.h. Gives same output.

---
 drivers/pinctrl/starfive/pinctrl-starfive-jhb100.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pinctrl/starfive/pinctrl-starfive-jhb100.c +2 -1
index 462a26697..329153876 100644
@@ -20,6 +20,7 @@
 #include <linux/seq_file.h>
 #include <linux/spinlock.h>
 #include <linux/string.h>
+#include <linux/string_choices.h>
 
 #include <linux/pinctrl/consumer.h>
 #include <linux/pinctrl/pinconf.h>
@@ -1152,7 +1153,7 @@ static int jhb100_irq_set_wake(struct irq_data *d, unsigned int enable)
 		ret = disable_irq_wake(sfp->irq);
 	if (ret)
 		dev_err(sfp->dev, "failed to %s wake-up interrupt\n",
-			enable ? "enable" : "disable");
+			str_enable_disable(enable));
 
 	return ret;
 }
Signature · 1 line
2.46.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines

Replace the open coded ternary in the jhb100_irq_set_wake() function with the helper from string_choices.h. Gives same output.

Best Regards,
Changhuang

Quoted 29 lines
---
 drivers/pinctrl/starfive/pinctrl-starfive-jhb100.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/pinctrl/starfive/pinctrl-starfive-jhb100.c +2 -1
index 462a26697..329153876 100644
@@ -20,6 +20,7 @@
 #include <linux/seq_file.h>
 #include <linux/spinlock.h>
 #include <linux/string.h>
+#include <linux/string_choices.h>
 
 #include <linux/pinctrl/consumer.h>
 #include <linux/pinctrl/pinconf.h>
@@ -1152,7 +1153,7 @@ static int jhb100_irq_set_wake(struct irq_data *d,
 unsigned int enable)
 		ret = disable_irq_wake(sfp->irq);
 	if (ret)
 		dev_err(sfp->dev, "failed to %s wake-up interrupt\n",
-			enable ? "enable" : "disable");
+			str_enable_disable(enable));
 
 	return ret;

}
--
2.46.0