Message ID | 20230306195556.55475-15-andriy.shevchenko@linux.intel.com |
---|---|
State | Handled Elsewhere |
Headers | show |
Series | gpio: Use string_choices.h | expand |
On Mon, Mar 06, 2023 at 09:55:54PM +0200, Andy Shevchenko wrote: > 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@linux.intel.com> > --- Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Thanks, Charles
diff --git a/drivers/gpio/gpio-wm831x.c b/drivers/gpio/gpio-wm831x.c index 7eaf8a28638c..5456485ce801 100644 --- a/drivers/gpio/gpio-wm831x.c +++ b/drivers/gpio/gpio-wm831x.c @@ -15,6 +15,7 @@ #include <linux/mfd/core.h> #include <linux/platform_device.h> #include <linux/seq_file.h> +#include <linux/string_choices.h> #include <linux/mfd/wm831x/core.h> #include <linux/mfd/wm831x/pdata.h> @@ -229,8 +230,8 @@ static void wm831x_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) seq_printf(s, " %s %s %s %s%s\n" " %s%s (0x%4x)\n", - reg & WM831X_GPN_DIR ? "in" : "out", - wm831x_gpio_get(chip, i) ? "high" : "low", + str_in_out(reg & WM831X_GPN_DIR), + str_high_low(wm831x_gpio_get(chip, i)), pull, powerdomain, reg & WM831X_GPN_POL ? "" : " inverted",
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@linux.intel.com> --- drivers/gpio/gpio-wm831x.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)