summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/edb7312.c
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2011-06-02 14:00:35 (GMT)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>2011-09-11 12:02:08 (GMT)
commit6cb03c9cb520186859a034e4e829fb591aea78b6 (patch)
tree962510ab7ca49fc9a8cc600b887263ce7da4427e /drivers/mtd/nand/edb7312.c
parent5b55b1eb21a5aba9c6cf4e0325ac9e4dffa89435 (diff)
downloadlinux-fsl-qoriq-6cb03c9cb520186859a034e4e829fb591aea78b6.tar.xz
mtd: edb7312.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@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/nand/edb7312.c')
-rw-r--r--drivers/mtd/nand/edb7312.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/mtd/nand/edb7312.c b/drivers/mtd/nand/edb7312.c
index 2f9374b..0b1bb91 100644
--- a/drivers/mtd/nand/edb7312.c
+++ b/drivers/mtd/nand/edb7312.c
@@ -104,9 +104,6 @@ static int ep7312_device_ready(struct mtd_info *mtd)
static int __init ep7312_init(void)
{
struct nand_chip *this;
- const char *part_type = 0;
- int mtd_parts_nb = 0;
- struct mtd_partition *mtd_parts = 0;
void __iomem *ep7312_fio_base;
/* Allocate memory for MTD device structure and private data */
@@ -156,20 +153,10 @@ static int __init ep7312_init(void)
return -ENXIO;
}
ep7312_mtd->name = "edb7312-nand";
- mtd_parts_nb = parse_mtd_partitions(ep7312_mtd, NULL, &mtd_parts, 0);
- if (mtd_parts_nb > 0)
- part_type = "command line";
- else
- mtd_parts_nb = 0;
- if (mtd_parts_nb == 0) {
- 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(ep7312_mtd, mtd_parts, mtd_parts_nb);
+ mtd_device_register(ep7312_mtd, NULL, 0,
+ partition_info, NUM_PARTITIONS);
/* Return happy */
return 0;