mtd: h1910.c: use mtd_device_parse_register
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Mon Nov 7 11:59:16 EST 2011
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=4571c1396260d3f235d987f4acdadfba820f57bf
Commit: 4571c1396260d3f235d987f4acdadfba820f57bf
Parent: 0d04eda1430e9a796214bee644b7e05d99cfe613
Author: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
AuthorDate: Thu Jun 2 18:00:40 2011 +0400
Committer: Artem Bityutskiy <artem.bityutskiy at intel.com>
CommitDate: Sun Sep 11 15:02:08 2011 +0300
mtd: h1910.c: use mtd_device_parse_register
Replace custom invocations of parse_mtd_partitions and mtd_device_register
with common mtd_device_parse_register call. This would bring: standard
handling of all errors, fallback to default partitions, etc.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
---
drivers/mtd/nand/h1910.c | 15 ++-------------
1 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/drivers/mtd/nand/h1910.c b/drivers/mtd/nand/h1910.c
index 42f9177..5dc6f0d 100644
--- a/drivers/mtd/nand/h1910.c
+++ b/drivers/mtd/nand/h1910.c
@@ -81,9 +81,6 @@ static int h1910_device_ready(struct mtd_info *mtd)
static int __init h1910_init(void)
{
struct nand_chip *this;
- const char *part_type = 0;
- int mtd_parts_nb = 0;
- struct mtd_partition *mtd_parts = 0;
void __iomem *nandaddr;
if (!machine_is_h1900())
@@ -136,18 +133,10 @@ static int __init h1910_init(void)
iounmap((void *)nandaddr);
return -ENXIO;
}
- mtd_parts_nb = parse_mtd_partitions(h1910_nand_mtd, NULL, &mtd_parts, 0);
- if (mtd_parts_nb > 0)
- part_type = "command line";
- else {
- mtd_parts = partition_info;
- mtd_parts_nb = NUM_PARTITIONS;
- part_type = "static";
- }
/* Register the partitions */
- printk(KERN_NOTICE "Using %s partition definition\n", part_type);
- mtd_device_register(h1910_nand_mtd, mtd_parts, mtd_parts_nb);
+ mtd_device_parse_register(h1910_nand_mtd, NULL, 0,
+ partition_info, NUM_PARTITIONS);
/* Return happy */
return 0;
More information about the linux-mtd-cvs
mailing list