spi: flash: enable write before every chunk to write in flash_write()
This commit is contained in:
parent
d17c80e7eb
commit
7a3e5a7679
1 changed files with 2 additions and 4 deletions
|
@ -123,9 +123,9 @@ static size_t spi_flash_write(struct flash_dev *dev, uint32_t addr,
|
|||
struct spi_dev *spi_dev = dev->priv;
|
||||
size_t nbytes, ret = 0;
|
||||
|
||||
spi_flash_write_enable(dev);
|
||||
|
||||
while (len) {
|
||||
spi_flash_write_enable(dev);
|
||||
|
||||
cmd[0] = SPI_FLASH_PAGE_PROGRAM;
|
||||
spi_flash_addr(cmd, addr);
|
||||
|
||||
|
@ -141,8 +141,6 @@ static size_t spi_flash_write(struct flash_dev *dev, uint32_t addr,
|
|||
ret += nbytes;
|
||||
}
|
||||
|
||||
spi_flash_write_disable(dev);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue