[U-Boot] [PATCH 1/3] MX28: SPI: Refactor spi_xfer a bit

Marek Vasut marex at denx.de
Mon Jul 9 12:13:54 CEST 2012


Dear Stefano Babic,

> On 09/07/2012 03:33, Marek Vasut wrote:
> > This makes it easier to adapt for addition of DMA support.
> > 
> > Signed-off-by: Marek Vasut <marex at denx.de>
> > Cc: Fabio Estevam <festevam at freescale.com>
> > Cc: Otavio Salvador <otavio at ossystems.com.br>
> > Cc: Stefano Babic <sbabic at denx.de>
> > Cc: Wolfgang Denk <wd at denx.de>
> > ---

[...]

> You do not need this if-then-else chain. I think is more readable with :

I think you're right ;-)

> 	if (din && dout) {
> 		/* Half-duplex only */
> 		return -EINVAL;
> 	}
> 	if (!din && !dout) {
> 		/* No data */
>   		return 0;
> 	}
> 
> 
> Best regards,
> Stefano Babic

Best regards,
Marek Vasut


More information about the U-Boot mailing list