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: fix pinctrl/gpio dependency ordering
Date: Tue, 10 Jan 2023 18:41:04 +0100	[thread overview]
Message-ID: <20230110174104.51204-1-a.fatoum@pengutronix.de> (raw)

pinctrl_register will apply pinctrl hogs if specified and the STM32
pinctrl driver expects the GPIO chips to be registered by then.

Swap the order of registration to accommodate this.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/pinctrl/pinctrl-stm32.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-stm32.c b/drivers/pinctrl/pinctrl-stm32.c
index 5e6625072a8f..15d845e0ad34 100644
--- a/drivers/pinctrl/pinctrl-stm32.c
+++ b/drivers/pinctrl/pinctrl-stm32.c
@@ -368,12 +368,6 @@ static int stm32_pinctrl_probe(struct device *dev)
 		dev_dbg(dev, "proceeding without hw spinlock support: (%d)\n",
 			ret);
 
-	ret = pinctrl_register(&pinctrl->pdev);
-	if (ret) {
-		dev_dbg(dev, "pinctrl_register failed: (%d)\n", ret);
-		return ret;
-	}
-
 	gpio_bank = pinctrl->gpio_banks;
 	for_each_available_child_of_node(np, child) {
 		if (!of_property_read_bool(child, "gpio-controller"))
@@ -389,9 +383,7 @@ static int stm32_pinctrl_probe(struct device *dev)
 		gpio_bank++;
 	}
 
-	dev_dbg(dev, "pinctrl/gpio driver registered\n");
-
-	return 0;
+	return pinctrl_register(&pinctrl->pdev);
 }
 
 static __maybe_unused struct of_device_id stm32_pinctrl_dt_ids[] = {
-- 
2.30.2




             reply	other threads:[~2023-01-10 17:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10 17:41 Ahmad Fatoum [this message]
2023-01-11  7:59 ` 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=20230110174104.51204-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