mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] pinctrl: stm32: support deep probe
Date: Mon, 28 Jun 2021 09:03:30 +0200	[thread overview]
Message-ID: <20210628070330.13646-1-a.fatoum@pengutronix.de> (raw)

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


             reply	other threads:[~2021-06-28  7:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28  7:03 Ahmad Fatoum [this message]
2021-06-28 20:38 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210628070330.13646-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox