summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2018-01-23 17:14:57 +0100
committerJagan Teki <jagan@amarulasolutions.com>2018-01-24 12:03:43 +0530
commit6c94bd12c4adca45033ef89daafa66fbfc9acd17 (patch)
tree2ea111f5aec70ff4e3ee245b6f65baa6711bfa35 /drivers/mtd/spi
parent8af74edc30bb60a90a5c4d2769ff3129b187796e (diff)
drivers: spi: consider command bytes when sending transfers
Command bytes are part of the written bytes and they should be taken into account when sending a spi transfer. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Reviewed-by: Jagan Teki <jagan@openedev.com>
Diffstat (limited to 'drivers/mtd/spi')
-rw-r--r--drivers/mtd/spi/spi_flash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c
index e40e1c01de..294d9f9d79 100644
--- a/drivers/mtd/spi/spi_flash.c
+++ b/drivers/mtd/spi/spi_flash.c
@@ -405,7 +405,7 @@ int spi_flash_cmd_write_ops(struct spi_flash *flash, u32 offset,
if (spi->max_write_size)
chunk_len = min(chunk_len,
- (size_t)spi->max_write_size);
+ spi->max_write_size - sizeof(cmd));
spi_flash_addr(write_addr, cmd);