[U-Boot] [PATCH v3] spi: fsl_espi: Return all data read from device unmodified
Joakim Tjernlund
Joakim.Tjernlund at infinera.com
Sat Dec 12 18:10:38 CET 2015
On Fri, 2015-12-11 at 21:19 -0500, Dale P. Smith wrote:
> Signed-off-by: Dale P. Smith <dsmith at vtiinstruments.com>
> ---
> Changes for v2:
> - First attempt at using git format-patch
> Changes for v3:
> - Fix subject.
> - Add changelog
While this is a step in the right direction, this driver needs a rewrite.
- The malloc/memcpy crap need to go.
- TXing 4 bytes a time while while word size is still one byte makes Not full/Not empty
HW flags useless.
There is no real maintainer of this driver though so I am afraid nobody will do make this happen.
>
> drivers/spi/fsl_espi.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c
> index b1586d1..c84a7ea 100644
> --- a/drivers/spi/fsl_espi.c
> +++ b/drivers/spi/fsl_espi.c
> @@ -345,17 +345,11 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *data_out,
> }
> }
> }
> - if (data_in) {
> - memcpy(data_in, buffer + 2 * cmd_len, tran_len);
> - if (*buffer == 0x0b) {
> - data_in += tran_len;
> - data_len -= tran_len;
> - *(int *)buffer += tran_len;
> - }
> - }
> spi_cs_deactivate(slave);
> }
>
> + if (data_in)
> + memcpy(data_in, buffer + rx_offset, len);
> free(buffer);
> return 0;
> }
More information about the U-Boot
mailing list