]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
Revert "gpio: Access `gpio_bus_type` in gpiochip_setup_dev()"
authorTzung-Bi Shih <tzungbi@kernel.org>
Fri, 13 Mar 2026 05:41:12 +0000 (05:41 +0000)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Mon, 16 Mar 2026 09:10:02 +0000 (10:10 +0100)
commit3518fd4c780d4fa4c0e2cedd95c0f8bc5d8b457f
tree0de878d29a7424f47ea1ea4b18ffb14a4c4ba7d1
parent7673e4c7f7f99bfc9f30294ac8ab769dbb386866
Revert "gpio: Access `gpio_bus_type` in gpiochip_setup_dev()"

This reverts commit cc11f4ef666fbca02c8a2f11d0184d57e6b75579.

Commit cc11f4ef666f ("gpio: Access `gpio_bus_type` in
gpiochip_setup_dev()") moved the bus type assignment from
gpiochip_add_data_with_key() to gpiochip_setup_dev().

This change introduced a bug where dev_printk() and friends might access
the bus name after gpiochip_add_data_with_key() but before
gpiochip_setup_dev() has run.  In this window, the bus type is not yet
initialized, leading to empty bus names in logs.

Move the bus type assignment back to gpiochip_add_data_with_key() to
ensure the bus name is available before any potential users like
dev_printk().

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Closes: https://lore.kernel.org/all/CAMuHMdU0Xb=Moca5LUex+VxyHQa2-uYJgYf4hzHiSEjDCQQT=Q@mail.gmail.com/
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://patch.msgid.link/20260313054112.1248074-1-tzungbi@kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
drivers/gpio/gpiolib.c