[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230306195556.55475-17-andriy.shevchenko@linux.intel.com>
Date: Mon, 6 Mar 2023 21:55:56 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Schspa Shi <schspa@...il.com>, Marc Zyngier <maz@...nel.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-pwm@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
patches@...nsource.cirrus.com
Cc: Linus Walleij <linus.walleij@...aro.org>,
Doug Berger <opendmb@...il.com>,
Florian Fainelli <f.fainelli@...il.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@...adcom.com>,
Andy Shevchenko <andy@...nel.org>,
Thierry Reding <thierry.reding@...il.com>,
Uwe Kleine-König
<u.kleine-koenig@...gutronix.de>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
Nandor Han <nandor.han@...com>,
Semi Malinen <semi.malinen@...com>
Subject: [PATCH v1 16/16] gpio: xra1403: Utilize helpers from string_choices.h
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@...ux.intel.com>
---
drivers/gpio/gpio-xra1403.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/gpio-xra1403.c b/drivers/gpio/gpio-xra1403.c
index 49c878cfd5c6..bc17beaba9e7 100644
--- a/drivers/gpio/gpio-xra1403.c
+++ b/drivers/gpio/gpio-xra1403.c
@@ -15,6 +15,7 @@
#include <linux/seq_file.h>
#include <linux/spi/spi.h>
#include <linux/regmap.h>
+#include <linux/string_choices.h>
/* XRA1403 registers */
#define XRA_GSR 0x00 /* GPIO State */
@@ -140,8 +141,8 @@ static void xra1403_dbg_show(struct seq_file *s, struct gpio_chip *chip)
for_each_requested_gpio(chip, i, label) {
seq_printf(s, " gpio-%-3d (%-12s) %s %s\n",
chip->base + i, label,
- (gcr & BIT(i)) ? "in" : "out",
- (gsr & BIT(i)) ? "hi" : "lo");
+ str_in_out(gcr & BIT(i)),
+ str_hi_lo(gsr & BIT(i)));
}
}
#else
--
2.39.1
Powered by blists - more mailing lists