mtd: jz4740_nand: convert to mtd_device_register()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue May 24 21:59:14 EDT 2011


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=85358b2aa951ad096af444765baf1e275e8a0749
Commit:     85358b2aa951ad096af444765baf1e275e8a0749
Parent:     c4a5522020ab3842880359aaae4464f08dcc74d5
Author:     Jamie Iles <jamie at jamieiles.com>
AuthorDate: Mon May 23 10:23:25 2011 +0100
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Wed May 25 02:23:30 2011 +0100

    mtd: jz4740_nand: convert to mtd_device_register()
    
    Convert to mtd_device_register() and remove the CONFIG_MTD_PARTITIONS
    preprocessor conditionals as partitioning is always available.
    
    Signed-off-by: Jamie Iles <jamie at jamieiles.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/jz4740_nand.c |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/drivers/mtd/nand/jz4740_nand.c b/drivers/mtd/nand/jz4740_nand.c
index cea38a5..6e813da 100644
--- a/drivers/mtd/nand/jz4740_nand.c
+++ b/drivers/mtd/nand/jz4740_nand.c
@@ -299,10 +299,8 @@ 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;
-#ifdef CONFIG_MTD_PARTITIONS
 	struct mtd_partition *partition_info;
 	int num_partitions = 0;
-#endif
 
 	nand = kzalloc(sizeof(*nand), GFP_KERNEL);
 	if (!nand) {
@@ -375,7 +373,6 @@ static int __devinit jz_nand_probe(struct platform_device *pdev)
 		goto err_gpio_free;
 	}
 
-#ifdef CONFIG_MTD_PARTITIONS
 #ifdef CONFIG_MTD_CMDLINE_PARTS
 	num_partitions = parse_mtd_partitions(mtd, part_probes,
 						&partition_info, 0);
@@ -384,12 +381,7 @@ static int __devinit jz_nand_probe(struct platform_device *pdev)
 		num_partitions = pdata->num_partitions;
 		partition_info = pdata->partitions;
 	}
-
-	if (num_partitions > 0)
-		ret = add_mtd_partitions(mtd, partition_info, num_partitions);
-	else
-#endif
-	ret = add_mtd_device(mtd);
+	ret = mtd_device_register(mtd, partition_info, num_partitions);
 
 	if (ret) {
 		dev_err(&pdev->dev, "Failed to add mtd device\n");



More information about the linux-mtd-cvs mailing list