From: Robert Jarzmik <robert.jarzmik@free.fr>
To: barebox@lists.infradead.org
Subject: [PATCH 1/2] drivers/mtd: introduce {add,del}_nand_device
Date: Mon, 12 Dec 2011 18:14:05 +0100 [thread overview]
Message-ID: <1323710046-4455-2-git-send-email-robert.jarzmik@free.fr> (raw)
In-Reply-To: <1323710046-4455-1-git-send-email-robert.jarzmik@free.fr>
As legacy nand support has already defined the functions
add_mtd_device and del_mtd_device, rename these to
add_nand_device and del_nand_device, as they are nand
specialized and not mtd generic.
This prevents them from clashing with the core generic add
and del mtd device.
If consensus if reached further, these nand functions could
be replaced by the core ones, as long as the core
functionality is judged rich enough to suit nand
maintainers.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
---
drivers/mtd/nand/atmel_nand.c | 2 +-
drivers/mtd/nand/diskonchip.c | 8 ++++----
drivers/mtd/nand/nand.c | 4 ++--
drivers/mtd/nand/nand.h | 3 +++
drivers/mtd/nand/nand_base.c | 2 +-
drivers/mtd/nand/nand_imx.c | 2 +-
drivers/mtd/nand/nand_omap_gpmc.c | 2 +-
drivers/mtd/nand/nand_s3c2410.c | 2 +-
drivers/mtd/nand/nomadik_nand.c | 2 +-
9 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 8cc1b51..663f51b 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -485,7 +485,7 @@ static int __init atmel_nand_probe(struct device_d *dev)
goto err_scan_tail;
}
- add_mtd_device(mtd);
+ add_nand_device(mtd);
if (!res)
return res;
diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c
index 2433945..688a7a9 100644
--- a/drivers/mtd/nand/diskonchip.c
+++ b/drivers/mtd/nand/diskonchip.c
@@ -1358,7 +1358,7 @@ static int __init nftl_scan_bbt(struct mtd_info *mtd)
At least as nand_bbt.c is currently written. */
if ((ret = nand_scan_bbt(mtd, NULL)))
return ret;
- add_mtd_device(mtd);
+ add_nand_device(mtd);
#ifdef CONFIG_MTD_PARTITIONS
if (!no_autopart)
add_mtd_partitions(mtd, parts, numparts);
@@ -1418,7 +1418,7 @@ static int __init inftl_scan_bbt(struct mtd_info *mtd)
do without it for non-INFTL use, since all it gives us is
autopartitioning, but I want to give it more thought. */
if (!numparts) return -EIO;
- add_mtd_device(mtd);
+ add_nand_device(mtd);
#ifdef CONFIG_MTD_PARTITIONS
if (!no_autopart)
add_mtd_partitions(mtd, parts, numparts);
@@ -1687,9 +1687,9 @@ static inline int __init doc_probe(unsigned long physadr)
/* DBB note: i believe nand_release is necessary here, as
buffers may have been allocated in nand_base. Check with
Thomas. FIX ME! */
- /* nand_release will call del_mtd_device, but we haven't yet
+ /* nand_release will call del_nand_device, but we haven't yet
added it. This is handled without incident by
- del_mtd_device, as far as I can tell. */
+ del_nand_device, as far as I can tell. */
nand_release(mtd);
kfree(mtd);
goto fail;
diff --git a/drivers/mtd/nand/nand.c b/drivers/mtd/nand/nand.c
index 6db21d6..84d1183 100644
--- a/drivers/mtd/nand/nand.c
+++ b/drivers/mtd/nand/nand.c
@@ -249,7 +249,7 @@ static void nand_exit_oob_cdev(struct mtd_info *mtd)
}
#endif
-int add_mtd_device(struct mtd_info *mtd)
+int add_nand_device(struct mtd_info *mtd)
{
char str[16];
@@ -279,7 +279,7 @@ int add_mtd_device(struct mtd_info *mtd)
return 0;
}
-int del_mtd_device (struct mtd_info *mtd)
+int del_nand_device(struct mtd_info *mtd)
{
unregister_device(&mtd->class_dev);
nand_exit_oob_cdev(mtd);
diff --git a/drivers/mtd/nand/nand.h b/drivers/mtd/nand/nand.h
index 123258d..c8c7c51 100644
--- a/drivers/mtd/nand/nand.h
+++ b/drivers/mtd/nand/nand.h
@@ -1,6 +1,9 @@
#ifndef __NAND_H
#define __NAND_H
+int add_nand_device(struct mtd_info *mtd);
+int del_nand_device(struct mtd_info *mtd);
+
int nand_read_oob_std(struct mtd_info *mtd, struct nand_chip *chip,
int page, int sndcmd);
int nand_write_oob_std(struct mtd_info *mtd, struct nand_chip *chip,
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index ec0f4a3..01244f0 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1461,7 +1461,7 @@ void nand_release(struct mtd_info *mtd)
struct nand_chip *chip = mtd->priv;
/* Deregister the device */
- del_mtd_device(mtd);
+ del_nand_device(mtd);
/* Free bad block table memory */
kfree(chip->bbt);
diff --git a/drivers/mtd/nand/nand_imx.c b/drivers/mtd/nand/nand_imx.c
index c8c69d6..d5d1226 100644
--- a/drivers/mtd/nand/nand_imx.c
+++ b/drivers/mtd/nand/nand_imx.c
@@ -1176,7 +1176,7 @@ static int __init imxnd_probe(struct device_d *dev)
goto escan;
}
- add_mtd_device(mtd);
+ add_nand_device(mtd);
dev->priv = host;
diff --git a/drivers/mtd/nand/nand_omap_gpmc.c b/drivers/mtd/nand/nand_omap_gpmc.c
index d5e642a..8d4d7b4 100644
--- a/drivers/mtd/nand/nand_omap_gpmc.c
+++ b/drivers/mtd/nand/nand_omap_gpmc.c
@@ -956,7 +956,7 @@ static int gpmc_nand_probe(struct device_d *pdev)
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);
+ err = add_nand_device(minfo);
if (err) {
dev_dbg(pdev, "device registration failed\n");
goto out_release_mem;
diff --git a/drivers/mtd/nand/nand_s3c2410.c b/drivers/mtd/nand/nand_s3c2410.c
index c5f5d97..f5910e1 100644
--- a/drivers/mtd/nand/nand_s3c2410.c
+++ b/drivers/mtd/nand/nand_s3c2410.c
@@ -485,7 +485,7 @@ static int s3c24x0_nand_probe(struct device_d *dev)
goto on_error;
}
- return add_mtd_device(mtd);
+ return add_nand_device(mtd);
on_error:
free(host);
diff --git a/drivers/mtd/nand/nomadik_nand.c b/drivers/mtd/nand/nomadik_nand.c
index c1e93ad..2719f8b 100644
--- a/drivers/mtd/nand/nomadik_nand.c
+++ b/drivers/mtd/nand/nomadik_nand.c
@@ -220,7 +220,7 @@ static int nomadik_nand_probe(struct device_d *dev)
}
pr_info("Registering %s as whole device\n", mtd->name);
- add_mtd_device(mtd);
+ add_nand_device(mtd);
return 0;
--
1.7.5.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2011-12-12 17:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-12 17:14 [PATCH 0/2] drivers/mtd: add a core Robert Jarzmik
2011-12-12 17:14 ` Robert Jarzmik [this message]
2011-12-12 17:14 ` [PATCH 2/2] drivers/mtd: add a core mtd handler Robert Jarzmik
2011-12-13 9:21 ` [PATCH 0/2] drivers/mtd: add a core Sascha Hauer
2011-12-13 10:46 ` Robert Jarzmik
2011-12-13 11:11 ` Sascha Hauer
2011-12-13 10:51 ` Robert Jarzmik
2011-12-13 11:29 ` Sascha Hauer
2011-12-13 12:35 ` Robert Jarzmik
2011-12-13 18:58 ` Sascha Hauer
2011-12-14 10:01 ` Robert Jarzmik
2011-12-14 11:02 ` Sascha Hauer
2011-12-14 14:20 ` Robert Jarzmik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1323710046-4455-2-git-send-email-robert.jarzmik@free.fr \
--to=robert.jarzmik@free.fr \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox