altera_qspi: initialize instr.mtd in flash_erase

Initialize instr.mtd in flash_erase(). This fixes the system
hang issue when CONFIG_MTD_PARTITIONS is selected.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
Acked-by: Marek Vasut <marex@denx.de>
This commit is contained in:
Thomas Chou 2015-12-18 21:35:08 +08:00
parent 11b35d557b
commit 1c0e84ca82

View File

@ -81,6 +81,7 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
int ret;
memset(&instr, 0, sizeof(instr));
instr.mtd = mtd;
instr.addr = mtd->erasesize * s_first;
instr.len = mtd->erasesize * (s_last + 1 - s_first);
ret = mtd_erase(mtd, &instr);