mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] pinctrl: stm32: support deep probe
@ 2021-06-28  7:03 Ahmad Fatoum
  2021-06-28 20:38 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2021-06-28  7:03 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

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@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"))
 			continue;
 
-		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");
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-28 20:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-28  7:03 [PATCH] pinctrl: stm32: support deep probe Ahmad Fatoum
2021-06-28 20:38 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox