[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230306195556.55475-9-andriy.shevchenko@linux.intel.com>
Date: Mon, 6 Mar 2023 21:55:48 +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 08/16] gpio: crystalcove: 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.
While at, utilize specifier field for padding the strings where
it's required.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
drivers/gpio/gpio-crystalcove.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/gpio/gpio-crystalcove.c b/drivers/gpio/gpio-crystalcove.c
index 1ee62cd58582..56d628b18397 100644
--- a/drivers/gpio/gpio-crystalcove.c
+++ b/drivers/gpio/gpio-crystalcove.c
@@ -15,6 +15,7 @@
#include <linux/platform_device.h>
#include <linux/regmap.h>
#include <linux/seq_file.h>
+#include <linux/string_choices.h>
#include <linux/types.h>
#define CRYSTALCOVE_GPIO_NUM 16
@@ -315,15 +316,15 @@ static void crystalcove_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip
&irq);
offset = gpio % 8;
- seq_printf(s, " gpio-%-2d %s %s %s %s ctlo=%2x,%s %s %s\n",
- gpio, ctlo & CTLO_DIR_OUT ? "out" : "in ",
- ctli & 0x1 ? "hi" : "lo",
- ctli & CTLI_INTCNT_NE ? "fall" : " ",
- ctli & CTLI_INTCNT_PE ? "rise" : " ",
+ seq_printf(s, " gpio-%-2d %-3.3s %-2.2s %-4.4s %-4.4s ctlo=%2x,%-9.9s %-9.9s %s\n",
+ gpio, str_out_in(ctlo & CTLO_DIR_OUT),
+ str_hi_lo(ctli & BIT(0)),
+ ctli & CTLI_INTCNT_NE ? "fall" : "",
+ ctli & CTLI_INTCNT_PE ? "rise" : "",
ctlo,
- mirqs0 & BIT(offset) ? "s0 mask " : "s0 unmask",
- mirqsx & BIT(offset) ? "sx mask " : "sx unmask",
- irq & BIT(offset) ? "pending" : " ");
+ mirqs0 & BIT(offset) ? "s0 mask" : "s0 unmask",
+ mirqsx & BIT(offset) ? "sx mask" : "sx unmask",
+ irq & BIT(offset) ? "pending" : "");
}
}
--
2.39.1
Powered by blists - more mailing lists