summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Wahren <wahrenst@gmx.net>2024-06-03 21:19:38 +0300
committerLinus Walleij <linus.walleij@linaro.org>2024-06-17 10:50:11 +0300
commit1583dc1627f6f9a24f570eec53fa20f1b4a5758f (patch)
treec29d6d60deb8e6ba60143dde4262431315a5ac82
parent1d1f3b8490b57c388a65f6c81fd867b1ec7e836b (diff)
downloadlinux-1583dc1627f6f9a24f570eec53fa20f1b4a5758f.tar.xz
pinctrl: bcm2835: Use string_choices API instead of ternary operator
Use modern string_choices API instead of manually determining the output using ternary operator. Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Stefan Wahren <wahrenst@gmx.net> Acked-by: Florian Fainelli <florian.fainelli@broadcom.com> Link: https://lore.kernel.org/r/20240603181938.76047-3-wahrenst@gmx.net Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/pinctrl/bcm/pinctrl-bcm2835.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
index 7178a38475cc..4d33bdf9d4b6 100644
--- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
+++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
@@ -34,6 +34,7 @@
#include <linux/seq_file.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
+#include <linux/string_choices.h>
#include <linux/types.h>
#include <dt-bindings/pinctrl/bcm2835.h>
@@ -752,7 +753,7 @@ static void bcm2835_pctl_pin_dbg_show(struct pinctrl_dev *pctldev,
int irq = irq_find_mapping(chip->irq.domain, offset);
seq_printf(s, "function %s in %s; irq %d (%s)",
- fname, value ? "hi" : "lo",
+ fname, str_hi_lo(value),
irq, irq_type_names[pc->irq_type[offset]]);
}
@@ -1428,7 +1429,7 @@ static int bcm2835_pinctrl_probe(struct platform_device *pdev)
}
dev_info(dev, "GPIO_OUT persistence: %s\n",
- persist_gpio_outputs ? "yes" : "no");
+ str_yes_no(persist_gpio_outputs));
return 0;