From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ahmed Samir Khalil Date: Sat, 11 Jun 2016 21:47:43 +0200 Subject: [U-Boot] [PATCH] Drivers: SPI: spi_slave struct has no member called bus nor cs. Message-ID: <1465674463-8960-1-git-send-email-engkhalil86@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In case of Driver Model, spi_slave structure (in spi.c) doesn't have member called bus or cs. Compiler error will be reported when using the new Driver Model while assigning bus & cs to non-members. This compiler error becomes obvious while applying the step-by-step documented in spi-howto.txt Signed-off-by: Ahmed Samir Khalil --- drivers/spi/spi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 7d81fbd..b02c7ab 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -31,8 +31,10 @@ void *spi_do_alloc_slave(int offset, int size, unsigned int bus, if (ptr) { memset(ptr, '\0', size); slave = (struct spi_slave *)(ptr + offset); +#ifndef CONFIG_DM_SPI slave->bus = bus; slave->cs = cs; +#endif slave->wordlen = SPI_DEFAULT_WORDLEN; } -- 2.7.4