Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2 -4
+2 -4
drivers/gpio/gpio-wm8994.c
··· 194 194 int i; 195 195 196 196 for (i = 0; i < chip->ngpio; i++) { 197 - int gpio = i + chip->base; 198 197 int reg; 199 198 200 199 /* We report the GPIO even if it's not requested since ··· 207 208 continue; 208 209 } 209 210 210 - seq_printf(s, " gpio-%-3d (%-20.20s) ", gpio, 211 + seq_printf(s, " gpio-%-3d (%-20.20s) ", i, 211 212 label ?: "Unrequested"); 212 213 213 214 reg = wm8994_reg_read(wm8994, WM8994_GPIO_1 + i); 214 215 if (reg < 0) { 215 216 dev_err(wm8994->dev, 216 - "GPIO control %d read failed: %d\n", 217 - gpio, reg); 217 + "GPIO control %d read failed: %d\n", i, reg); 218 218 seq_printf(s, "\n"); 219 219 continue; 220 220 }