120-13-v5.19-mtd-nand-mtk-ecc-also-parse-nand-ecc-engine-if-avail.patch 1.0 KB

123456789101112131415161718192021222324252627282930
  1. From 433b76fa0f3ca2865841abc21538dd8077ca3edd Mon Sep 17 00:00:00 2001
  2. From: Chuanhong Guo <[email protected]>
  3. Date: Mon, 4 Apr 2022 00:05:38 +0800
  4. Subject: [PATCH 13/15] mtd: nand: mtk-ecc: also parse nand-ecc-engine if
  5. available
  6. The recently added ECC engine support introduced a generic property
  7. named nand-ecc-engine for ecc engine phandle. This patch adds support
  8. for this new property.
  9. Signed-off-by: Chuanhong Guo <[email protected]>
  10. (cherry picked from commit a41f25feb6e47c1c4d8d3279ae990ccbd8dfab54)
  11. ---
  12. drivers/mtd/nand/ecc-mtk.c | 5 ++++-
  13. 1 file changed, 4 insertions(+), 1 deletion(-)
  14. --- a/drivers/mtd/nand/ecc-mtk.c
  15. +++ b/drivers/mtd/nand/ecc-mtk.c
  16. @@ -279,7 +279,10 @@ struct mtk_ecc *of_mtk_ecc_get(struct de
  17. struct mtk_ecc *ecc = NULL;
  18. struct device_node *np;
  19. - np = of_parse_phandle(of_node, "ecc-engine", 0);
  20. + np = of_parse_phandle(of_node, "nand-ecc-engine", 0);
  21. + /* for backward compatibility */
  22. + if (!np)
  23. + np = of_parse_phandle(of_node, "ecc-engine", 0);
  24. if (np) {
  25. ecc = mtk_ecc_get(np);
  26. of_node_put(np);