mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] spi: Probe spi devices without alias
@ 2025-06-10 15:24 Jonas Rebmann
  2025-06-11  6:37 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Jonas Rebmann @ 2025-06-10 15:24 UTC (permalink / raw)
  To: Sascha Hauer, BAREBOX; +Cc: Jonas Rebmann

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>




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

end of thread, other threads:[~2025-06-11  6:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-10 15:24 [PATCH] spi: Probe spi devices without alias Jonas Rebmann
2025-06-11  6:37 ` Sascha Hauer

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