Skip to content

Commit 3e8b723

Browse files
jhovoldBartosz Golaszewski
authored andcommitted
gpiolib: fix debugfs newline separators
The gpiolib debugfs interface exports a list of all gpio chips in a system and the state of their pins. The gpio chip sections are supposed to be separated by a newline character, but a long-standing bug prevents the separator from being included when output is generated in multiple sessions, making the output inconsistent and hard to read. Make sure to only suppress the newline separator at the beginning of the file as intended. Fixes: f9c4a31 ("gpiolib: Use seq_file's iterator interface") Cc: stable@vger.kernel.org # 3.7 Cc: Thierry Reding <treding@nvidia.com> Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20241028125000.24051-2-johan+linaro@kernel.org Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent 90bad74 commit 3e8b723

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/gpio/gpiolib.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4926,6 +4926,8 @@ static void *gpiolib_seq_start(struct seq_file *s, loff_t *pos)
49264926
return NULL;
49274927

49284928
s->private = priv;
4929+
if (*pos > 0)
4930+
priv->newline = true;
49294931
priv->idx = srcu_read_lock(&gpio_devices_srcu);
49304932

49314933
list_for_each_entry_srcu(gdev, &gpio_devices, list,

0 commit comments

Comments
 (0)