Commit f838154a authored by Paul Cercueil's avatar Paul Cercueil Committed by Miquel Raynal

mtd: rawnand: ingenic: Make use of ecc-engine property

Use the 'ecc-engine' standard property instead of the custom
'ingenic,bch-controller' custom property, which is now deprecated.
Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent 15de8c6e
...@@ -83,9 +83,9 @@ static struct ingenic_ecc *ingenic_ecc_get(struct device_node *np) ...@@ -83,9 +83,9 @@ static struct ingenic_ecc *ingenic_ecc_get(struct device_node *np)
/** /**
* of_ingenic_ecc_get() - get the ECC controller from a DT node * of_ingenic_ecc_get() - get the ECC controller from a DT node
* @of_node: the node that contains a bch-controller property. * @of_node: the node that contains an ecc-engine property.
* *
* Get the bch-controller property from the given device tree * Get the ecc-engine property from the given device tree
* node and pass it to ingenic_ecc_get to do the work. * node and pass it to ingenic_ecc_get to do the work.
* *
* Return: a pointer to ingenic_ecc, errors are encoded into the pointer. * Return: a pointer to ingenic_ecc, errors are encoded into the pointer.
...@@ -96,7 +96,14 @@ struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *of_node) ...@@ -96,7 +96,14 @@ struct ingenic_ecc *of_ingenic_ecc_get(struct device_node *of_node)
struct ingenic_ecc *ecc = NULL; struct ingenic_ecc *ecc = NULL;
struct device_node *np; struct device_node *np;
np = of_parse_phandle(of_node, "ingenic,bch-controller", 0); np = of_parse_phandle(of_node, "ecc-engine", 0);
/*
* If the ecc-engine property is not found, check for the deprecated
* ingenic,bch-controller property
*/
if (!np)
np = of_parse_phandle(of_node, "ingenic,bch-controller", 0);
if (np) { if (np) {
ecc = ingenic_ecc_get(np); ecc = ingenic_ecc_get(np);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment