From 5b85daacc6ddaa3a3a3f38788f6b1bfac3a1c8d3 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 27 Feb 2013 14:25:30 +0100 Subject: mtd: nand: register nand flashes with nand specific function This allows us to have some NAND specific stuff during registration, like for example adding NAND specific device parameters. Signed-off-by: Sascha Hauer --- drivers/mtd/nand/atmel_nand.c | 2 +- drivers/mtd/nand/nand_base.c | 11 +++++++++++ drivers/mtd/nand/nand_imx.c | 2 +- drivers/mtd/nand/nand_mxs.c | 2 +- drivers/mtd/nand/nand_omap_gpmc.c | 2 +- drivers/mtd/nand/nand_s3c24xx.c | 2 +- drivers/mtd/nand/nomadik_nand.c | 2 +- 7 files changed, 17 insertions(+), 6 deletions(-) (limited to 'drivers') diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c index 63484f8196..81ccad92ba 100644 --- a/drivers/mtd/nand/atmel_nand.c +++ b/drivers/mtd/nand/atmel_nand.c @@ -1223,7 +1223,7 @@ static int __init atmel_nand_probe(struct device_d *dev) goto err_scan_tail; } - add_mtd_device(mtd, "nand"); + add_mtd_nand_device(mtd, "nand"); if (!res) return res; diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 411aba7398..c0345c7398 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -1672,4 +1672,15 @@ EXPORT_SYMBOL(nand_scan_ident); EXPORT_SYMBOL(nand_scan_tail); EXPORT_SYMBOL(nand_release); +int add_mtd_nand_device(struct mtd_info *mtd, char *devname) +{ + int ret; + + ret = add_mtd_device(mtd, devname); + if (ret) + return ret; + + return ret; +} + #endif /* DOXYGEN_SHOULD_SKIP_THIS */ diff --git a/drivers/mtd/nand/nand_imx.c b/drivers/mtd/nand/nand_imx.c index dd668619d5..842c1deb1c 100644 --- a/drivers/mtd/nand/nand_imx.c +++ b/drivers/mtd/nand/nand_imx.c @@ -1260,7 +1260,7 @@ static int __init imxnd_probe(struct device_d *dev) goto escan; } - add_mtd_device(mtd, "nand"); + add_mtd_nand_device(mtd, "nand"); dev->priv = host; diff --git a/drivers/mtd/nand/nand_mxs.c b/drivers/mtd/nand/nand_mxs.c index 3812ac9ddb..dd43a95f57 100644 --- a/drivers/mtd/nand/nand_mxs.c +++ b/drivers/mtd/nand/nand_mxs.c @@ -1252,7 +1252,7 @@ static int mxs_nand_probe(struct device_d *dev) if (err) goto err2; - return add_mtd_device(mtd, "nand"); + return add_mtd_nand_device(mtd, "nand"); err2: free(nand_info->data_buf); free(nand_info->cmd_buf); diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c index 7849db5b11..d4482518fb 100644 --- a/drivers/mtd/nand/nand_omap_gpmc.c +++ b/drivers/mtd/nand/nand_omap_gpmc.c @@ -1060,7 +1060,7 @@ static int gpmc_nand_probe(struct device_d *pdev) omap_gpmc_eccmode(oinfo, pdata->ecc_mode); /* We are all set to register with the system now! */ - err = add_mtd_device(minfo, "nand"); + err = add_mtd_nand_device(minfo, "nand"); if (err) { dev_dbg(pdev, "device registration failed\n"); goto out_release_mem; diff --git a/drivers/mtd/nand/nand_s3c24xx.c b/drivers/mtd/nand/nand_s3c24xx.c index fef94328b1..c68c9fb161 100644 --- a/drivers/mtd/nand/nand_s3c24xx.c +++ b/drivers/mtd/nand/nand_s3c24xx.c @@ -483,7 +483,7 @@ static int s3c24x0_nand_probe(struct device_d *dev) goto on_error; } - return add_mtd_device(mtd, "nand"); + return add_mtd_nand_device(mtd, "nand"); on_error: free(host); diff --git a/drivers/mtd/nand/nomadik_nand.c b/drivers/mtd/nand/nomadik_nand.c index 834b6ac32a..afdbef12fd 100644 --- a/drivers/mtd/nand/nomadik_nand.c +++ b/drivers/mtd/nand/nomadik_nand.c @@ -221,7 +221,7 @@ static int nomadik_nand_probe(struct device_d *dev) } pr_info("Registering %s as whole device\n", mtd->name); - add_mtd_device(mtd, "nand"); + add_mtd_nand_device(mtd, "nand"); return 0; -- cgit v1.2.3