[PATCH v1 15/16] gpio: wm8994: Utilize helpers from string_choices.h
Andy Shevchenko
andriy.shevchenko at linux.intel.com
Mon Mar 6 11:55:55 PST 2023
There are a few helpers available to convert a boolean variable
to the dedicated string literals depending on the application.
Use them in the driver.
Signed-off-by: Andy Shevchenko <andriy.shevchenko at linux.intel.com>
---
drivers/gpio/gpio-wm8994.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/gpio/gpio-wm8994.c b/drivers/gpio/gpio-wm8994.c
index f4a474cef32d..15757d94448a 100644
--- a/drivers/gpio/gpio-wm8994.c
+++ b/drivers/gpio/gpio-wm8994.c
@@ -16,6 +16,7 @@
#include <linux/platform_device.h>
#include <linux/seq_file.h>
#include <linux/regmap.h>
+#include <linux/string_choices.h>
#include <linux/mfd/wm8994/core.h>
#include <linux/mfd/wm8994/pdata.h>
@@ -215,10 +216,7 @@ static void wm8994_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
continue;
}
- if (reg & WM8994_GPN_DIR)
- seq_printf(s, "in ");
- else
- seq_printf(s, "out ");
+ seq_printf(s, "%s ", str_in_out(reg & WM8994_GPN_DIR));
if (reg & WM8994_GPN_PU)
seq_printf(s, "pull up ");
--
2.39.1
More information about the linux-arm-kernel
mailing list