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

Configure Feed

Select the types of activity you want to include in your feed.

gpio: Remove redundant check for struct gpio_chip

gpiolib_dbg_show() is only called by gpiolib_seq_show() which has
ensured the struct gpio_chip. Remove the redundant check in
gpiolib_dbg_show().

Reviewed-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://patch.msgid.link/20260223061726.82161-3-tzungbi@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

authored by

Tzung-Bi Shih and committed by
Bartosz Golaszewski
049f7113 cc11f4ef

+2 -11
+2 -11
drivers/gpio/gpiolib.c
··· 5322 5322 5323 5323 #ifdef CONFIG_DEBUG_FS 5324 5324 5325 - static void gpiolib_dbg_show(struct seq_file *s, struct gpio_device *gdev) 5325 + static void gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *gc) 5326 5326 { 5327 5327 bool active_low, is_irq, is_out; 5328 5328 struct gpio_desc *desc; 5329 5329 unsigned int gpio = 0; 5330 - struct gpio_chip *gc; 5331 5330 unsigned long flags; 5332 5331 int value; 5333 - 5334 - guard(srcu)(&gdev->srcu); 5335 - 5336 - gc = srcu_dereference(gdev->chip, &gdev->srcu); 5337 - if (!gc) { 5338 - seq_puts(s, "Underlying GPIO chip is gone\n"); 5339 - return; 5340 - } 5341 5332 5342 5333 for_each_gpio_desc(gc, desc) { 5343 5334 guard(srcu)(&desc->gdev->desc_srcu); ··· 5442 5451 if (gc->dbg_show) 5443 5452 gc->dbg_show(s, gc); 5444 5453 else 5445 - gpiolib_dbg_show(s, gdev); 5454 + gpiolib_dbg_show(s, gc); 5446 5455 5447 5456 return 0; 5448 5457 }