diff options
| author | Mike Frysinger <vapier@gentoo.org> | 2012-03-04 23:18:17 -0500 |
|---|---|---|
| committer | Mike Frysinger <vapier@gentoo.org> | 2012-03-04 23:18:17 -0500 |
| commit | 41e1713425d9817fdbe4fc89ad11b8dc9c4fca30 (patch) | |
| tree | cc284fbfb28cd5da90278a9af9849596cb82548e /drivers/mtd/spi/sst.c | |
| parent | 7a6d2a7ec1afb53df8b78185fe77d66423c8dcea (diff) | |
| download | olio-uboot-2014.01-41e1713425d9817fdbe4fc89ad11b8dc9c4fca30.tar.xz olio-uboot-2014.01-41e1713425d9817fdbe4fc89ad11b8dc9c4fca30.zip | |
sf: unify status register writing (and thus block unlocking)
The only two drivers to write the status register do it in the same
way, so unify the implementations. This also makes the block unlock
logic the same.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'drivers/mtd/spi/sst.c')
| -rw-r--r-- | drivers/mtd/spi/sst.c | 23 |
1 files changed, 1 insertions, 22 deletions
diff --git a/drivers/mtd/spi/sst.c b/drivers/mtd/spi/sst.c index 04cc50abc..ced4f2473 100644 --- a/drivers/mtd/spi/sst.c +++ b/drivers/mtd/spi/sst.c @@ -185,27 +185,6 @@ sst_write_wp(struct spi_flash *flash, u32 offset, size_t len, const void *buf) return ret; } -static int -sst_unlock(struct spi_flash *flash) -{ - int ret; - u8 cmd, status; - - ret = spi_flash_cmd_write_enable(flash); - if (ret) - return ret; - - cmd = CMD_WRITE_STATUS; - status = 0; - ret = spi_flash_cmd_write(flash->spi, &cmd, 1, &status, 1); - if (ret) - debug("SF: Unable to set status byte\n"); - - debug("SF: sst: status = %x\n", spi_w8r8(flash->spi, CMD_READ_STATUS)); - - return ret; -} - struct spi_flash * spi_flash_probe_sst(struct spi_slave *spi, u8 *idcode) { @@ -245,7 +224,7 @@ spi_flash_probe_sst(struct spi_slave *spi, u8 *idcode) stm->flash.size = stm->flash.sector_size * params->nr_sectors; /* Flash powers up read-only, so clear BP# bits */ - sst_unlock(&stm->flash); + spi_flash_cmd_write_status(&stm->flash, 0); return &stm->flash; } |