diff options
author | Jamie Iles <jamie@jamieiles.com> | 2011-05-23 05:23:25 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2011-05-24 21:23:30 -0400 |
commit | 85358b2aa951ad096af444765baf1e275e8a0749 (patch) | |
tree | c8a44aa1e0fc4555c8c6a3d31cfb01d65731498c /drivers/mtd | |
parent | c4a5522020ab3842880359aaae4464f08dcc74d5 (diff) |
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@jamieiles.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | 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 cea38a5d4ac5..6e813daed068 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) | |||
299 | struct nand_chip *chip; | 299 | struct nand_chip *chip; |
300 | struct mtd_info *mtd; | 300 | struct mtd_info *mtd; |
301 | struct jz_nand_platform_data *pdata = pdev->dev.platform_data; | 301 | struct jz_nand_platform_data *pdata = pdev->dev.platform_data; |
302 | #ifdef CONFIG_MTD_PARTITIONS | ||
303 | struct mtd_partition *partition_info; | 302 | struct mtd_partition *partition_info; |
304 | int num_partitions = 0; | 303 | int num_partitions = 0; |
305 | #endif | ||
306 | 304 | ||
307 | nand = kzalloc(sizeof(*nand), GFP_KERNEL); | 305 | nand = kzalloc(sizeof(*nand), GFP_KERNEL); |
308 | if (!nand) { | 306 | if (!nand) { |
@@ -375,7 +373,6 @@ static int __devinit jz_nand_probe(struct platform_device *pdev) | |||
375 | goto err_gpio_free; | 373 | goto err_gpio_free; |
376 | } | 374 | } |
377 | 375 | ||
378 | #ifdef CONFIG_MTD_PARTITIONS | ||
379 | #ifdef CONFIG_MTD_CMDLINE_PARTS | 376 | #ifdef CONFIG_MTD_CMDLINE_PARTS |
380 | num_partitions = parse_mtd_partitions(mtd, part_probes, | 377 | num_partitions = parse_mtd_partitions(mtd, part_probes, |
381 | &partition_info, 0); | 378 | &partition_info, 0); |
@@ -384,12 +381,7 @@ static int __devinit jz_nand_probe(struct platform_device *pdev) | |||
384 | num_partitions = pdata->num_partitions; | 381 | num_partitions = pdata->num_partitions; |
385 | partition_info = pdata->partitions; | 382 | partition_info = pdata->partitions; |
386 | } | 383 | } |
387 | 384 | ret = mtd_device_register(mtd, partition_info, num_partitions); | |
388 | if (num_partitions > 0) | ||
389 | ret = add_mtd_partitions(mtd, partition_info, num_partitions); | ||
390 | else | ||
391 | #endif | ||
392 | ret = add_mtd_device(mtd); | ||
393 | 385 | ||
394 | if (ret) { | 386 | if (ret) { |
395 | dev_err(&pdev->dev, "Failed to add mtd device\n"); | 387 | dev_err(&pdev->dev, "Failed to add mtd device\n"); |