gpio: wm8994: don't print out global GPIO numbers in debugfs callbacks

In order to further limit the number of references to the GPIO base
number stored in struct gpio_chip, replace the global GPIO numbers in
the output of debugfs callbacks by hardware offsets.

Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20250826-gpio-dbg-show-base-v1-4-7f27cd7f2256@linaro.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This commit is contained in:
Bartosz Golaszewski 2025-08-26 11:54:38 +02:00
parent 3767426b23
commit aaa1279b8b
1 changed files with 2 additions and 4 deletions

View File

@ -194,7 +194,6 @@ static void wm8994_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
int i; int i;
for (i = 0; i < chip->ngpio; i++) { for (i = 0; i < chip->ngpio; i++) {
int gpio = i + chip->base;
int reg; int reg;
/* We report the GPIO even if it's not requested since /* We report the GPIO even if it's not requested since
@ -208,14 +207,13 @@ static void wm8994_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
continue; continue;
} }
seq_printf(s, " gpio-%-3d (%-20.20s) ", gpio, seq_printf(s, " gpio-%-3d (%-20.20s) ", i,
label ?: "Unrequested"); label ?: "Unrequested");
reg = wm8994_reg_read(wm8994, WM8994_GPIO_1 + i); reg = wm8994_reg_read(wm8994, WM8994_GPIO_1 + i);
if (reg < 0) { if (reg < 0) {
dev_err(wm8994->dev, dev_err(wm8994->dev,
"GPIO control %d read failed: %d\n", "GPIO control %d read failed: %d\n", i, reg);
gpio, reg);
seq_printf(s, "\n"); seq_printf(s, "\n");
continue; continue;
} }