diff options
| author | Uwe Kleine-König <u.kleine-koenig@baylibre.com> | 2025-12-10 10:02:53 +0300 |
|---|---|---|
| committer | Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> | 2025-12-17 12:15:07 +0300 |
| commit | 30eb99dfd3439f25d0f79815f7f859da03fc8fff (patch) | |
| tree | f746ac54e73d3c058a3abb5607de9cd57234a2a9 | |
| parent | 8f0b4cce4481fb22653697cced8d0d04027cb1e8 (diff) | |
| download | linux-30eb99dfd3439f25d0f79815f7f859da03fc8fff.tar.xz | |
gpio: stub: Drop empty probe function
A probe callback that just returns 0 does the same as not having a probe
callback at all. So gpio_stub_drv_probe() can be dropped without side
effects.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/20251210070255.484169-2-u.kleine-koenig@baylibre.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
| -rw-r--r-- | drivers/gpio/gpiolib.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 91e0c384f34a..409c2f415251 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -5242,27 +5242,21 @@ void gpiod_put_array(struct gpio_descs *descs) } EXPORT_SYMBOL_GPL(gpiod_put_array); -static int gpio_stub_drv_probe(struct device *dev) -{ - /* - * The DT node of some GPIO chips have a "compatible" property, but - * never have a struct device added and probed by a driver to register - * the GPIO chip with gpiolib. In such cases, fw_devlink=on will cause - * the consumers of the GPIO chip to get probe deferred forever because - * they will be waiting for a device associated with the GPIO chip - * firmware node to get added and bound to a driver. - * - * To allow these consumers to probe, we associate the struct - * gpio_device of the GPIO chip with the firmware node and then simply - * bind it to this stub driver. - */ - return 0; -} - +/* + * The DT node of some GPIO chips have a "compatible" property, but + * never have a struct device added and probed by a driver to register + * the GPIO chip with gpiolib. In such cases, fw_devlink=on will cause + * the consumers of the GPIO chip to get probe deferred forever because + * they will be waiting for a device associated with the GPIO chip + * firmware node to get added and bound to a driver. + * + * To allow these consumers to probe, we associate the struct + * gpio_device of the GPIO chip with the firmware node and then simply + * bind it to this stub driver. + */ static struct device_driver gpio_stub_drv = { .name = "gpio_stub_drv", .bus = &gpio_bus_type, - .probe = gpio_stub_drv_probe, }; static int __init gpiolib_dev_init(void) |
