mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jonas Rebmann <jre@pengutronix.de>
To: Sascha Hauer <s.hauer@pengutronix.de>,
	 BAREBOX <barebox@lists.infradead.org>
Cc: Jonas Rebmann <jre@pengutronix.de>
Subject: [PATCH] spi: Probe spi devices without alias
Date: Tue, 10 Jun 2025 17:24:56 +0200	[thread overview]
Message-ID: <20250610-imx_spi_alias-v1-1-fc23f2f143ea@pengutronix.de> (raw)

Continue probing spi connected devices without an alias. Setting bus_num
to -1 will assign numbers automatically.

Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
---
 drivers/spi/imx_spi.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/spi/imx_spi.c b/drivers/spi/imx_spi.c
index bfb4b413ebab0e62e92f61db52a866a1d55b9ae3..14c4baada8e03ce1b38031afc68de7b261d43e78 100644
--- a/drivers/spi/imx_spi.c
+++ b/drivers/spi/imx_spi.c
@@ -604,9 +604,10 @@ static int imx_spi_probe(struct device *dev)
 		imx->cs_array = pdata->chipselect;
 	} else if (IS_ENABLED(CONFIG_OFDEVICE)) {
 		ret = of_alias_get_id(dev->of_node, "spi");
-		if (ret < 0)
-			goto err_free;
-		master->bus_num = ret;
+		if (ret >= 0)
+			master->bus_num = ret;
+		else
+			master->bus_num = -1;
 		imx_spi_dt_probe(imx);
 	}
 

---
base-commit: 508059d413816818905f86c64145f6a7a1a1f998
change-id: 20250610-imx_spi_alias-0a09ae52cbaf

Best regards,
-- 
Jonas Rebmann <jre@pengutronix.de>




             reply	other threads:[~2025-06-10 18:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-10 15:24 Jonas Rebmann [this message]
2025-06-11  6:37 ` 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=20250610-imx_spi_alias-v1-1-fc23f2f143ea@pengutronix.de \
    --to=jre@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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