[PATCH] pinctrl: stm32: support deep probe

Ahmad Fatoum a.fatoum at pengutronix.de
Mon Jun 28 00:03:30 PDT 2021

The GPIO children of the pinctrl node don't have their own compatibles
and so the pinctrl driver probe takes care of the whole family.

GPIO drivers when deep probe is enabled don't like that because they
expect a driver to be associated with the GPIO device tree node, once
the chip was registered. Make them happy by assigning the dummy driver.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
 drivers/pinctrl/pinctrl-stm32.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/pinctrl-stm32.c b/drivers/pinctrl/pinctrl-stm32.c
index 09b62309f6a1..97a643a4da67 100644
--- a/drivers/pinctrl/pinctrl-stm32.c
+++ b/drivers/pinctrl/pinctrl-stm32.c
@@ -412,11 +412,14 @@ static int stm32_pinctrl_probe(struct device_d *dev)
 		if (!of_property_read_bool(child, "gpio-controller"))
-		ret = stm32_gpiochip_add(gpio_bank++, child, dev);
+		ret = stm32_gpiochip_add(gpio_bank, child, dev);
 		if (ret) {
 			dev_err(dev, "couldn't add gpiochip %s, ret = %d\n", child->name, ret);
 			return ret;
+		of_platform_device_dummy_drv(gpio_bank->chip.dev);
+		gpio_bank++;
 	dev_dbg(dev, "pinctrl/gpio driver registered\n");

More information about the barebox mailing list