summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorNiklas Cassel <niklas.cassel@wdc.com>2022-02-08 22:52:43 +0000
committerJagan Teki <jagan@amarulasolutions.com>2022-02-24 13:40:49 +0530
commitd56dfc90c7bb2f29a38a98fc2e170ebba6fc6a40 (patch)
treeca930f12c8f98c2da275658e2e4920ca8de8dc05 /arch
parente145606ff29364e948c05d492732f623674d6010 (diff)
downloadu-boot-d56dfc90c7bb2f29a38a98fc2e170ebba6fc6a40.tar.gz
spi: dw: Fix broken dw_spi_mem_ops()
The driver is currently using sizeof(op->cmd.opcode) in the op_len calculation. Commit d15de623013c ("spi: spi-mem: allow specifying a command's extension") changed op->cmd.opcode from one byte to two. Instead, a new struct member op->cmd.nbytes is supposed to be used. For regular commands op->cmd.nbytes will be one. Commit d15de623013c ("spi: spi-mem: allow specifying a command's extension") did update some drivers that overload the generic mem_ops() implementation, but forgot to update dw_spi_mem_ops(). Calculating op_len incorrectly causes dw_spi_mem_ops() to misbehave, since op_len is used to determine how many bytes that should be read/written. On the canaan k210 board, this causes the probe of the SPI flash to fail. Fix the op_len calculation in dw_spi_mem_ops(). Doing so results in working SPI flash on the canaan k210 board. Fixes: d15de623013c ("spi: spi-mem: allow specifying a command's extension") Signed-off-by: Niklas Cassel <niklas.cassel@wdc.com> Reviewed-by: Pratyush Yadav <p.yadav@ti.com> Tested-by: Damien Le Moal <damien.lemoal@opensource.wdc.com> Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Diffstat (limited to 'arch')
0 files changed, 0 insertions, 0 deletions