spi: zynqmp_gqspi: Fix unaligned data writes issue

When unaligned 3 bytes data write operation is performed, 3rd byte
is being over written by 1st byte of 3 bytes data. This patch
fixes it.

Signed-off-by: T Karthik Reddy <t.karthik.reddy@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
This commit is contained in:
T Karthik Reddy 2020-11-19 05:00:36 -07:00 committed by Michal Simek
parent 6b80de790c
commit 90217487a1
1 changed files with 2 additions and 4 deletions

View File

@ -429,10 +429,8 @@ static int zynqmp_qspi_fill_tx_fifo(struct zynqmp_qspi_priv *priv, u32 size)
data |= GENMASK(31, 16);
break;
case 3:
data = *((u16 *)buf);
buf += 2;
data |= (*((u8 *)buf) << 16);
buf += 1;
data = *buf;
buf += 3;
data |= GENMASK(31, 24);
break;
}