mtd: jz4740_nand.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=90ee1fb3ac918362402a06d0f71545111f374980
Commit: 90ee1fb3ac918362402a06d0f71545111f374980
Parent: 4571c1396260d3f235d987f4acdadfba820f57bf
Author: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
AuthorDate: Thu Jun 2 18:00:41 2011 +0400
Committer: Artem Bityutskiy <artem.bityutskiy at intel.com>
CommitDate: Sun Sep 11 15:02:08 2011 +0300
mtd: jz4740_nand.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/jz4740_nand.c | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/mtd/nand/jz4740_nand.c b/drivers/mtd/nand/jz4740_nand.c
index 920719c..e266407 100644
--- a/drivers/mtd/nand/jz4740_nand.c
+++ b/drivers/mtd/nand/jz4740_nand.c
@@ -295,8 +295,6 @@ static int __devinit jz_nand_probe(struct platform_device *pdev)
struct nand_chip *chip;
struct mtd_info *mtd;
struct jz_nand_platform_data *pdata = pdev->dev.platform_data;
- struct mtd_partition *partition_info;
- int num_partitions = 0;
nand = kzalloc(sizeof(*nand), GFP_KERNEL);
if (!nand) {
@@ -369,12 +367,9 @@ static int __devinit jz_nand_probe(struct platform_device *pdev)
goto err_gpio_free;
}
- num_partitions = parse_mtd_partitions(mtd, NULL, &partition_info, 0);
- if (num_partitions <= 0 && pdata) {
- num_partitions = pdata->num_partitions;
- partition_info = pdata->partitions;
- }
- ret = mtd_device_register(mtd, partition_info, num_partitions);
+ ret = mtd_device_parse_register(mtd, NULL, 0,
+ pdata ? pdata->partitions : NULL,
+ pdata ? pdata->num_partitions : 0);
if (ret) {
dev_err(&pdev->dev, "Failed to add mtd device\n");
More information about the linux-mtd-cvs
mailing list