mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH v2 4/7] spi: Directly register SPI device
Date: Thu,  9 Mar 2023 12:52:05 +0100	[thread overview]
Message-ID: <20230309115208.973893-5-s.hauer@pengutronix.de> (raw)
In-Reply-To: <20230309115208.973893-1-s.hauer@pengutronix.de>

SPI devices described in the device tree are not directly registered,
but instead added to the SPI board_list which is normally used to
register SPI devices from board code. This seems rather unnecessary,
drop this detour and register SPI devices directly from
spi_of_register_slaves().

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/spi/spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index d6f939e51c..1444fe3741 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -138,7 +138,7 @@ static void spi_of_register_slaves(struct spi_controller *ctrl)
 			continue;
 		chip.chip_select = of_read_number(reg->value, 1);
 		chip.device_node = n;
-		spi_register_board_info(&chip, 1);
+		spi_new_device(ctrl, &chip);
 	}
 }
 
-- 
2.30.2




  parent reply	other threads:[~2023-03-09 12:04 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09 11:52 [PATCH v2 0/7] support overlays to the barebox live tree Sascha Hauer
2023-03-09 11:52 ` [PATCH v2 1/7] kbuild: Add target to build dtb overlay files Sascha Hauer
2023-03-09 13:24   ` Ahmad Fatoum
2023-03-09 15:28     ` Sascha Hauer
2023-03-09 15:33       ` Ahmad Fatoum
2023-03-09 15:35         ` Sascha Hauer
2023-03-09 11:52 ` [PATCH v2 2/7] driver: Add rescan hook to struct device Sascha Hauer
2023-03-09 12:54   ` Ahmad Fatoum
2023-03-09 13:39     ` Ahmad Fatoum
2023-03-09 13:08   ` Ahmad Fatoum
2023-03-09 15:41     ` Sascha Hauer
2023-03-10  8:37       ` Sascha Hauer
2023-03-09 11:52 ` [PATCH v2 3/7] i2c: implement rescan Sascha Hauer
2023-03-09 13:02   ` Ahmad Fatoum
2023-03-09 15:54     ` Sascha Hauer
2023-03-09 11:52 ` Sascha Hauer [this message]
2023-03-09 11:52 ` [PATCH v2 5/7] spi: reduce scope of 'chip' Sascha Hauer
2023-03-09 11:52 ` [PATCH v2 6/7] spi: implement rescan Sascha Hauer
2023-03-09 13:03   ` Ahmad Fatoum
2023-03-09 11:52 ` [PATCH v2 7/7] of_overlay: Add option to apply overlay to live tree 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=20230309115208.973893-5-s.hauer@pengutronix.de \
    --to=s.hauer@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