]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/mtd/maps/pxa2xx-flash.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[karo-tx-linux.git] / drivers / mtd / maps / pxa2xx-flash.c
index d8ae634d347ebc4262704188adb1dea943c909e6..f59d62f74d44a39ed9ccea62358ed64e57361f56 100644 (file)
@@ -104,23 +104,18 @@ static int __devinit pxa2xx_flash_probe(struct platform_device *pdev)
        }
        info->mtd->owner = THIS_MODULE;
 
-#ifdef CONFIG_MTD_PARTITIONS
        ret = parse_mtd_partitions(info->mtd, probes, &parts, 0);
 
        if (ret > 0) {
                info->nr_parts = ret;
                info->parts = parts;
        }
-#endif
 
-       if (info->nr_parts) {
-               add_mtd_partitions(info->mtd, info->parts,
-                                  info->nr_parts);
-       } else {
+       if (!info->nr_parts)
                printk("Registering %s as whole device\n",
                       info->map.name);
-               add_mtd_device(info->mtd);
-       }
+
+       mtd_device_register(info->mtd, info->parts, info->nr_parts);
 
        platform_set_drvdata(pdev, info);
        return 0;
@@ -132,12 +127,7 @@ static int __devexit pxa2xx_flash_remove(struct platform_device *dev)
 
        platform_set_drvdata(dev, NULL);
 
-#ifdef CONFIG_MTD_PARTITIONS
-       if (info->nr_parts)
-               del_mtd_partitions(info->mtd);
-       else
-#endif
-               del_mtd_device(info->mtd);
+       mtd_device_unregister(info->mtd);
 
        map_destroy(info->mtd);
        iounmap(info->map.virt);