All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Drivers: SPI: spi_slave struct has no member called bus nor cs.
@ 2016-06-11 19:47 Ahmed Samir Khalil
  2016-06-17  3:50 ` Simon Glass
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmed Samir Khalil @ 2016-06-11 19:47 UTC (permalink / raw)
  To: u-boot

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

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

* [U-Boot] [PATCH] Drivers: SPI: spi_slave struct has no member called bus nor cs.
  2016-06-11 19:47 [U-Boot] [PATCH] Drivers: SPI: spi_slave struct has no member called bus nor cs Ahmed Samir Khalil
@ 2016-06-17  3:50 ` Simon Glass
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Glass @ 2016-06-17  3:50 UTC (permalink / raw)
  To: u-boot

Hi Ahmen,

On 11 June 2016 at 13:47, Ahmed Samir Khalil <engkhalil86@gmail.com> wrote:
> 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;
>         }
>

This file should not be built when CONFIG_DM_SPI is enabled. Are you
using the latest mainline U-Boot?

Regards,
Simon

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

end of thread, other threads:[~2016-06-17  3:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-11 19:47 [U-Boot] [PATCH] Drivers: SPI: spi_slave struct has no member called bus nor cs Ahmed Samir Khalil
2016-06-17  3:50 ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.