By retrieving the ecc_mode from pdata we can use the same code for device tree 
and
non device tree probing. Which was not possible before, because ecc_mode was 
arbitrarily set to
NAND_ECC_SOFT.

Signed-off-by: Raphaël Poggi <poggi.r...@gmail.com>
---
 drivers/mtd/nand/atmel_nand.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index eba7125..82bee92 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -1208,7 +1208,7 @@ static int __init atmel_nand_probe(struct device_d *dev)
                goto err_no_card;
        }
        else {
-           pdata = dev->platform_data;
+           memcpy(host->board, dev->platform_data, sizeof(struct 
atmel_nand_data));
        }
 
        nand_chip->priv = host;         /* link the private data structures */
@@ -1257,7 +1257,7 @@ static int __init atmel_nand_probe(struct device_d *dev)
                }
        }
 
-       nand_chip->ecc.mode = NAND_ECC_SOFT;
+       nand_chip->ecc.mode = pdata->ecc_mode;
 
        if (IS_ENABLED(CONFIG_NAND_ECC_HW) &&
            pdata->ecc_mode == NAND_ECC_HW) {
-- 
1.7.9.5


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to