diff options
author | T Karthik Reddy <t.karthik.reddy@xilinx.com> | 2020-11-19 15:00:36 +0300 |
---|---|---|
committer | Michal Simek <michal.simek@xilinx.com> | 2021-01-04 12:51:27 +0300 |
commit | 90217487a13f73001654e41e152303644736617b (patch) | |
tree | c793581219d853f04f2c2b640d762671c43f720e /drivers/spi/zynqmp_gqspi.c | |
parent | 6b80de790cf95c5e2e3fab57b33a9db1004e4ccb (diff) | |
download | u-boot-90217487a13f73001654e41e152303644736617b.tar.xz |
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>
Diffstat (limited to 'drivers/spi/zynqmp_gqspi.c')
-rw-r--r-- | drivers/spi/zynqmp_gqspi.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/spi/zynqmp_gqspi.c b/drivers/spi/zynqmp_gqspi.c index e0e6687037..a56e8b2509 100644 --- a/drivers/spi/zynqmp_gqspi.c +++ b/drivers/spi/zynqmp_gqspi.c @@ -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; } |