From: Ahmed Samir Khalil <engkhalil86@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Drivers: SPI: spi_slave struct has no member called bus nor cs.
Date: Sat, 11 Jun 2016 21:47:43 +0200 [thread overview]
Message-ID: <1465674463-8960-1-git-send-email-engkhalil86@gmail.com> (raw)
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 <engkhalil86@gmail.com>
---
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
next reply other threads:[~2016-06-11 19:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-11 19:47 Ahmed Samir Khalil [this message]
2016-06-17 3:50 ` [U-Boot] [PATCH] Drivers: SPI: spi_slave struct has no member called bus nor cs Simon Glass
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=1465674463-8960-1-git-send-email-engkhalil86@gmail.com \
--to=engkhalil86@gmail.com \
--cc=u-boot@lists.denx.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