Skip to content

Commit ca32ee8

Browse files
d4ilyrungregkh
authored andcommitted
pinctrl: core: reset gpio_device in loop in pinctrl_pins_show()
[ Upstream commit 9dfbcf2 ] We were not resetting the pointer to the associated gpio_device once we are done displaying a pin's information. This meant that once we reached the end of a gpio-range, if there were pins right after it that did not belong to any known range, they would be associated with the previous range's gpio device. This resulted in those pins appearing as <4294966783:old_gdev> instead of the expected <0:?> (due to gpio_num being -1). Signed-off-by: Léo DUBOIN <lduboin@freebox.fr> Link: https://lore.kernel.org/r/c40d0634abefa19e689ffd450e0f48a8d63c4fc4.1714049455.git.lduboin@freebox.fr Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent f45f8af commit ca32ee8

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/pinctrl/core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,6 +1670,7 @@ static int pinctrl_pins_show(struct seq_file *s, void *what)
16701670
seq_printf(s, "pin %d (%s) ", pin, desc->name);
16711671

16721672
#ifdef CONFIG_GPIOLIB
1673+
gdev = NULL;
16731674
gpio_num = -1;
16741675
list_for_each_entry(range, &pctldev->gpio_ranges, node) {
16751676
if ((pin >= range->pin_base) &&

0 commit comments

Comments
 (0)