[U-Boot] [PATCH v3] spi: mxc_spi: Fix double incrementing read pointer for unaligned buffers

From: Timo Herbrecher t.herbrecher@gateware.de
If dout buffer is not 32 bit-aligned or data to transmit is not multiple of 32 bit the read data pointer is already incremented on single byte reads.
Signed-off-by: Timo Herbrecher t.herbrecher@gateware.de Signed-off-by: Jagannadha Sutradharudu Teki jaganna@xilinx.com --- Changes for v3: - Updated commit msg header Changes for v2: - none
drivers/spi/mxc_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c index fd72a65..95dd03f 100644 --- a/drivers/spi/mxc_spi.c +++ b/drivers/spi/mxc_spi.c @@ -255,8 +255,8 @@ int spi_xchg_single(struct spi_slave *slave, unsigned int bitlen, } else { data = *(u32 *)dout; data = cpu_to_be32(data); + dout += 4; } - dout += 4; } debug("Sending SPI 0x%x\n", data); reg_write(®s->txdata, data);

On Wed, Oct 16, 2013 at 12:11 AM, Jagannadha Sutradharudu Teki jagannadha.sutradharudu-teki@xilinx.com wrote:
From: Timo Herbrecher t.herbrecher@gateware.de
If dout buffer is not 32 bit-aligned or data to transmit is not multiple of 32 bit the read data pointer is already incremented on single byte reads.
Signed-off-by: Timo Herbrecher t.herbrecher@gateware.de Signed-off-by: Jagannadha Sutradharudu Teki jaganna@xilinx.com
Changes for v3: - Updated commit msg header Changes for v2: - none
drivers/spi/mxc_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/mxc_spi.c b/drivers/spi/mxc_spi.c index fd72a65..95dd03f 100644 --- a/drivers/spi/mxc_spi.c +++ b/drivers/spi/mxc_spi.c @@ -255,8 +255,8 @@ int spi_xchg_single(struct spi_slave *slave, unsigned int bitlen, } else { data = *(u32 *)dout; data = cpu_to_be32(data);
dout += 4; }
dout += 4; } debug("Sending SPI 0x%x\n", data); reg_write(®s->txdata, data);
-- 1.8.3
Applied to u-boot-spi/master
participants (2)
-
Jagan Teki
-
Jagannadha Sutradharudu Teki