[U-Boot] [PATCH] altera_qspi: initialize instr.mtd in flash_erase

Thomas Chou thomas at wytron.com.tw
Fri Dec 18 14:36:04 CET 2015


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

Signed-off-by: Thomas Chou <thomas at wytron.com.tw>
---
 drivers/mtd/altera_qspi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mtd/altera_qspi.c b/drivers/mtd/altera_qspi.c
index 617bf5d..c7e37ad 100644
--- a/drivers/mtd/altera_qspi.c
+++ b/drivers/mtd/altera_qspi.c
@@ -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);
-- 
2.5.0



More information about the U-Boot mailing list