summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorChuanhong Guo <gch981213@gmail.com>2022-04-24 11:25:25 +0800
committerMiquel Raynal <miquel.raynal@bootlin.com>2022-04-27 18:12:43 +0200
commit4c5bf4b51c9857e20c5f5e9d74b86aa1bd1def40 (patch)
tree58b7f8486404122079f9f8f1c9489dc29c3a74ac /drivers/mtd
parent4fd62f15afa0d0da4823f429a2fb4c3492a84edf (diff)
downloadlinux-4c5bf4b51c9857e20c5f5e9d74b86aa1bd1def40.tar.bz2
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
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/ecc-mtk.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mtd/nand/ecc-mtk.c b/drivers/mtd/nand/ecc-mtk.c
index 491c2d66f815..02c13778514d 100644
--- a/drivers/mtd/nand/ecc-mtk.c
+++ b/drivers/mtd/nand/ecc-mtk.c
@@ -278,7 +278,10 @@ struct mtk_ecc *of_mtk_ecc_get(struct device_node *of_node)
struct mtk_ecc *ecc = NULL;
struct device_node *np;
- np = of_parse_phandle(of_node, "ecc-engine", 0);
+ np = of_parse_phandle(of_node, "nand-ecc-engine", 0);
+ /* for backward compatibility */
+ if (!np)
+ np = of_parse_phandle(of_node, "ecc-engine", 0);
if (np) {
ecc = mtk_ecc_get(np);
of_node_put(np);