altera_qspi: initialize instr.mtd in flash_erase
PATCH 1/1 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 <[email protected]>
--- drivers/mtd/altera_qspi.c | 1 + 1 file changed, 1 insertion(+)
drivers/mtd/altera_qspi.c +1 -0
@@ -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);
Signature · 1 line
2.5.0
PATCH 1/1 altera_qspi: initialize instr.mtd in flash_erase
Quoted 13 lines · Thomas Chou
Initialize instr.mtd in
flash_erase(). This fixes the system hang issue whenCONFIG_MTD_PARTITIONSis selected.Signed-off-by Thomas Chou <[email protected]>--- drivers/mtd/altera_qspi.c | 1 + 1 file changed, 1 insertion(+)drivers/mtd/altera_qspi.c +0
-0
drivers/mtd/altera_qspi.c int flash_erase(flash_info_t *info, int s_first, int · line 87
Quoted 7 lines
drivers/mtd/altera_qspi.c +1
-0@@ -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);
Nice, took me a while to grasp where the bug triggers, but now I see it:
Acked-by Marek Vasut <[email protected]>
Best regards,
Marek Vasut