summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi/sf_ops.c
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2013-12-19 19:22:12 (GMT)
committerTom Rini <trini@ti.com>2013-12-19 19:22:12 (GMT)
commit1bbba03d0e01ac466d063732afff3a5faadde2d3 (patch)
treec03ba850505b4e01835c796616c6c67879a7fc61 /drivers/mtd/spi/sf_ops.c
parentef184040b74ebba48edbc3ae7bf84b2753b8774c (diff)
parentac5cce38de8f97a120b8c98f34be0d5eec50a6fb (diff)
downloadu-boot-fsl-qoriq-1bbba03d0e01ac466d063732afff3a5faadde2d3.tar.xz
Merge branch 'master' of git://git.denx.de/u-boot-spi
Diffstat (limited to 'drivers/mtd/spi/sf_ops.c')
-rw-r--r--drivers/mtd/spi/sf_ops.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mtd/spi/sf_ops.c b/drivers/mtd/spi/sf_ops.c
index 108665f..e316a69 100644
--- a/drivers/mtd/spi/sf_ops.c
+++ b/drivers/mtd/spi/sf_ops.c
@@ -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);
+ spi_release_bus(flash->spi);
return 0;
}