Skip to content

Commit 56704d8

Browse files
ezequielgarciacomputersforpeace
authored andcommitted
mtd: nand: pxa3xx: Use waitfunc() to wait for the device to be ready
In pxa3xx_nand_sensing() instead of simply using info->is_ready after issuing a command, the correct way of checking is to wait for the device to be ready through the chip's waitfunc(). Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Tested-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
1 parent 55d9fd6 commit 56704d8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/mtd/nand/pxa3xx_nand.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,10 +1036,11 @@ static int pxa3xx_nand_sensing(struct pxa3xx_nand_info *info)
10361036
return ret;
10371037

10381038
chip->cmdfunc(mtd, NAND_CMD_RESET, 0, 0);
1039-
if (!info->need_wait)
1040-
return 0;
1039+
ret = chip->waitfunc(mtd, chip);
1040+
if (ret & NAND_STATUS_FAIL)
1041+
return -ENODEV;
10411042

1042-
return -ENODEV;
1043+
return 0;
10431044
}
10441045

10451046
static int pxa3xx_nand_scan(struct mtd_info *mtd)

0 commit comments

Comments
 (0)