All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] fsl espi:  Fix reading from device
@ 2012-09-26 22:46 Dale P. Smith
  0 siblings, 0 replies; only message in thread
From: Dale P. Smith @ 2012-09-26 22:46 UTC (permalink / raw)
  To: u-boot

Return the actual bytes read from the device.
---
 drivers/spi/fsl_espi.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c
index a1ebd33..c0348db 100644
--- a/drivers/spi/fsl_espi.c
+++ b/drivers/spi/fsl_espi.c
@@ -291,16 +291,10 @@ int spi_xfer(struct spi_slave *slave, unsigned int bitlen, const void *data_out,
 				debug("***spi_xfer:...%08x readed\n", tmpdin);
 			}
 		}
-		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;
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-09-26 22:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-26 22:46 [U-Boot] [PATCH] fsl espi: Fix reading from device Dale P. Smith

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.