summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Kilb <J.Kilb@phytec.de>2011-06-09 21:40:32 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2011-06-10 08:58:39 +0200
commit42207a9cbbefbec4c7fb9aa13f51455e106c34f2 (patch)
tree80023eb174673eed40b4f14d988592f73bf831c3
parentaf2649b795f28a76d284b2548719dd3ae5e668ea (diff)
downloadbarebox-42207a9cbbefbec4c7fb9aa13f51455e106c34f2.tar.gz
barebox-42207a9cbbefbec4c7fb9aa13f51455e106c34f2.tar.xz
Improved gpmc_nand driver to show the current eccmode.
Now a 'devinfo gpmc_nand0' shows the current used eccmode instead of <NULL>. The function omap_gpmc_eccmode is now called by dev_set_param. Signed-off-by: Juergen Kilb <J.Kilb@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/mtd/nand/nand_omap_gpmc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c
index fc485514..4a2d561d 100644
--- a/drivers/mtd/nand/nand_omap_gpmc.c
+++ b/drivers/mtd/nand/nand_omap_gpmc.c
@@ -654,6 +654,8 @@ static int omap_gpmc_eccmode_set(struct device_d *dev, struct param_d *param, co
return -EINVAL;
}
+ dev_param_set_generic(dev, param, ecc_mode_strings[i]);
+
return omap_gpmc_eccmode(oinfo, i);
}
@@ -811,7 +813,9 @@ static int gpmc_nand_probe(struct device_d *pdev)
}
nand->options |= NAND_SKIP_BBTSCAN;
- omap_gpmc_eccmode(oinfo, pdata->ecc_mode);
+
+ dev_add_param(pdev, "eccmode", omap_gpmc_eccmode_set, NULL, 0);
+ dev_set_param(pdev, "eccmode", ecc_mode_strings[pdata->ecc_mode]);
/* We are all set to register with the system now! */
err = add_mtd_device(minfo);
@@ -820,8 +824,6 @@ static int gpmc_nand_probe(struct device_d *pdev)
goto out_release_mem;
}
- dev_add_param(pdev, "eccmode", omap_gpmc_eccmode_set, NULL, 0);
-
return 0;
out_release_mem: