From: Boris Brezillon Date: Thu, 13 Dec 2018 10:55:26 +0000 (+0100) Subject: mtd: rawnand: Fix JEDEC detection X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=b637ef779575a977068025f842ecd480a9671f3f;p=openwrt%2Fstaging%2Fblogic.git mtd: rawnand: Fix JEDEC detection nand_jedec_detect() should return 1 when the PARAM page parsing succeeds, otherwise the core considers JEDEC detection failed and falls back to ID-based detection. Fixes: 480139d9229e ("mtd: rawnand: get rid of the JEDEC parameter page in nand_chip") Cc: Signed-off-by: Boris Brezillon Acked-by: Miquel Raynal Signed-off-by: Miquel Raynal --- diff --git a/drivers/mtd/nand/raw/nand_jedec.c b/drivers/mtd/nand/raw/nand_jedec.c index 5c26492c841d..38b5dc22cb30 100644 --- a/drivers/mtd/nand/raw/nand_jedec.c +++ b/drivers/mtd/nand/raw/nand_jedec.c @@ -107,6 +107,8 @@ int nand_jedec_detect(struct nand_chip *chip) pr_warn("Invalid codeword size\n"); } + ret = 1; + free_jedec_param_page: kfree(p); return ret;