Commit 85358b2a authored by Jamie Iles's avatar Jamie Iles Committed by David Woodhouse

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: default avatarJamie Iles <jamie@jamieiles.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent c4a55220
...@@ -299,10 +299,8 @@ static int __devinit jz_nand_probe(struct platform_device *pdev) ...@@ -299,10 +299,8 @@ static int __devinit jz_nand_probe(struct platform_device *pdev)
struct nand_chip *chip; struct nand_chip *chip;
struct mtd_info *mtd; struct mtd_info *mtd;
struct jz_nand_platform_data *pdata = pdev->dev.platform_data; struct jz_nand_platform_data *pdata = pdev->dev.platform_data;
#ifdef CONFIG_MTD_PARTITIONS
struct mtd_partition *partition_info; struct mtd_partition *partition_info;
int num_partitions = 0; int num_partitions = 0;
#endif
nand = kzalloc(sizeof(*nand), GFP_KERNEL); nand = kzalloc(sizeof(*nand), GFP_KERNEL);
if (!nand) { if (!nand) {
...@@ -375,7 +373,6 @@ static int __devinit jz_nand_probe(struct platform_device *pdev) ...@@ -375,7 +373,6 @@ static int __devinit jz_nand_probe(struct platform_device *pdev)
goto err_gpio_free; goto err_gpio_free;
} }
#ifdef CONFIG_MTD_PARTITIONS
#ifdef CONFIG_MTD_CMDLINE_PARTS #ifdef CONFIG_MTD_CMDLINE_PARTS
num_partitions = parse_mtd_partitions(mtd, part_probes, num_partitions = parse_mtd_partitions(mtd, part_probes,
&partition_info, 0); &partition_info, 0);
...@@ -384,12 +381,7 @@ static int __devinit jz_nand_probe(struct platform_device *pdev) ...@@ -384,12 +381,7 @@ static int __devinit jz_nand_probe(struct platform_device *pdev)
num_partitions = pdata->num_partitions; num_partitions = pdata->num_partitions;
partition_info = pdata->partitions; partition_info = pdata->partitions;
} }
ret = mtd_device_register(mtd, partition_info, num_partitions);
if (num_partitions > 0)
ret = add_mtd_partitions(mtd, partition_info, num_partitions);
else
#endif
ret = add_mtd_device(mtd);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Failed to add mtd device\n"); dev_err(&pdev->dev, "Failed to add mtd device\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment