[U-Boot] [PATCH v3] spi: fsl_espi: Return all data read from device unmodified

Dale P. Smith dsmith at vtiinstruments.com
Sat Dec 12 03:19:19 CET 2015


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

 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;
 }
-- 
2.1.4



More information about the U-Boot mailing list