Skip to content

Commit 4c5bf4b

Browse files
981213miquelraynal
authored andcommitted
mtd: nand: mtk-ecc: also parse nand-ecc-engine if available
The recently added ECC engine support introduced a generic property named nand-ecc-engine for ecc engine phandle. This patch adds support for this new property. Signed-off-by: Chuanhong Guo <gch981213@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20220424032527.673605-4-gch981213@gmail.com
1 parent 4fd62f1 commit 4c5bf4b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/mtd/nand/ecc-mtk.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,10 @@ struct mtk_ecc *of_mtk_ecc_get(struct device_node *of_node)
278278
struct mtk_ecc *ecc = NULL;
279279
struct device_node *np;
280280

281-
np = of_parse_phandle(of_node, "ecc-engine", 0);
281+
np = of_parse_phandle(of_node, "nand-ecc-engine", 0);
282+
/* for backward compatibility */
283+
if (!np)
284+
np = of_parse_phandle(of_node, "ecc-engine", 0);
282285
if (np) {
283286
ecc = mtk_ecc_get(np);
284287
of_node_put(np);

0 commit comments

Comments
 (0)