Skip to content

Commit f33254d

Browse files
andy-shevlinusw
authored andcommitted
pinctrl: stmfx: Use string_choices API instead of ternary operator
Use modern string_choices API instead of manually determining the output using ternary operator. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Linus Walleij <[email protected]>
1 parent a9c470d commit f33254d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/pinctrl/pinctrl-stmfx.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/module.h>
1212
#include <linux/platform_device.h>
1313
#include <linux/seq_file.h>
14+
#include <linux/string_choices.h>
1415

1516
#include <linux/pinctrl/pinconf.h>
1617
#include <linux/pinctrl/pinmux.h>
@@ -369,14 +370,14 @@ static void stmfx_pinconf_dbg_show(struct pinctrl_dev *pctldev,
369370
return;
370371

371372
if (dir == GPIO_LINE_DIRECTION_OUT) {
372-
seq_printf(s, "output %s ", val ? "high" : "low");
373+
seq_printf(s, "output %s ", str_high_low(val));
373374
if (type)
374375
seq_printf(s, "open drain %s internal pull-up ",
375376
pupd ? "with" : "without");
376377
else
377378
seq_puts(s, "push pull no pull ");
378379
} else {
379-
seq_printf(s, "input %s ", val ? "high" : "low");
380+
seq_printf(s, "input %s ", str_high_low(val));
380381
if (type)
381382
seq_printf(s, "with internal pull-%s ",
382383
pupd ? "up" : "down");

0 commit comments

Comments
 (0)