Commit ac5cce38 authored by Poddar, Sourav's avatar Poddar, Sourav Committed by Jagannadha Sutradharudu Teki
Browse files

driver: mtd: sf_ops: claim bus while doing memcpy

claim spi bus while doing memory copy, this will set up
the spi controller device control register before doing
a memory read.
Signed-off-by: default avatarSourav Poddar <>
Tested-by: default avatarYebio Mesfin <>
Reviewed-by: default avatarJagannadha Sutradharudu Teki <>
parent 2c57b03b
......@@ -273,9 +273,15 @@ int spi_flash_cmd_read_ops(struct spi_flash *flash, u32 offset,
/* Handle memory-mapped SPI */
if (flash->memory_map) {
ret = spi_claim_bus(flash->spi);
if (ret) {
debug("SF: unable to claim SPI bus\n");
return ret;
spi_xfer(flash->spi, 0, NULL, NULL, SPI_XFER_MMAP);
memcpy(data, flash->memory_map + offset, len);
spi_xfer(flash->spi, 0, NULL, NULL, SPI_XFER_MMAP_END);
return 0;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment