diff options
| -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"); |
