dev->mtd.priv = dev;
        dev->mtd.owner = THIS_MODULE;
 
-       if (add_mtd_device(&dev->mtd)) {
+       if (mtd_device_register(&dev->mtd, NULL, 0)) {
                /* Device didn't get added, so free the entry */
                goto devinit_err;
        }
        list_for_each_safe(pos, next, &blkmtd_device_list) {
                struct block2mtd_dev *dev = list_entry(pos, typeof(*dev), list);
                block2mtd_sync(&dev->mtd);
-               del_mtd_device(&dev->mtd);
+               mtd_device_unregister(&dev->mtd);
                INFO("mtd%d: [%s] removed", dev->mtd.index,
                                dev->mtd.name + strlen("block2mtd: "));
                list_del(&dev->list);
 
                doc2klist = mtd;
                mtd->size = this->totlen;
                mtd->erasesize = this->erasesize;
-               add_mtd_device(mtd);
+               mtd_device_register(mtd, NULL, 0);
                return;
        }
 }
                this = mtd->priv;
                doc2klist = this->nextdoc;
 
-               del_mtd_device(mtd);
+               mtd_device_unregister(mtd);
 
                iounmap(this->virtadr);
                kfree(this->chips);
 
                this->nextdoc = docmillist;
                docmillist = mtd;
                mtd->size  = this->totlen;
-               add_mtd_device(mtd);
+               mtd_device_register(mtd, NULL, 0);
                return;
        }
 }
                this = mtd->priv;
                docmillist = this->nextdoc;
 
-               del_mtd_device(mtd);
+               mtd_device_unregister(mtd);
 
                iounmap(this->virtadr);
                kfree(this->chips);
 
                docmilpluslist = mtd;
                mtd->size  = this->totlen;
                mtd->erasesize = this->erasesize;
-               add_mtd_device(mtd);
+               mtd_device_register(mtd, NULL, 0);
                return;
        }
 }
                this = mtd->priv;
                docmilpluslist = this->nextdoc;
 
-               del_mtd_device(mtd);
+               mtd_device_unregister(mtd);
 
                iounmap(this->virtadr);
                kfree(this->chips);
 
 #endif
 
 #ifndef HAVE_PARTITIONS
-   result = add_mtd_device (&mtd);
+   result = mtd_device_register(&mtd, NULL, 0);
 #else
-   result = add_mtd_partitions (&mtd,lart_partitions, ARRAY_SIZE(lart_partitions));
+   result = mtd_device_register(&mtd, lart_partitions,
+                                ARRAY_SIZE(lart_partitions));
 #endif
 
    return (result);
 static void __exit lart_flash_exit (void)
 {
 #ifndef HAVE_PARTITIONS
-   del_mtd_device (&mtd);
+   mtd_device_unregister(&mtd);
 #else
-   del_mtd_partitions (&mtd);
+   mtd_device_unregister(&mtd);
 #endif
 }
 
 
        mtd->writesize = 1;
 
        ret = -EIO;
-       if (add_mtd_device(mtd)) {
+       if (mtd_device_register(mtd, NULL, 0)) {
                printk(KERN_ERR
                        "ms02-nv: Unable to register MTD device, aborting!\n");
                goto err_out_csr_res;
 
        root_ms02nv_mtd = mp->next;
 
-       del_mtd_device(mtd);
+       mtd_device_unregister(mtd);
 
        release_resource(mp->resource.csr);
        kfree(mp->resource.csr);
 
 static void __exit cleanup_mtdram(void)
 {
        if (mtd_info) {
-               del_mtd_device(mtd_info);
+               mtd_device_unregister(mtd_info);
                vfree(mtd_info->priv);
                kfree(mtd_info);
        }
        mtd->read = ram_read;
        mtd->write = ram_write;
 
-       if (add_mtd_device(mtd)) {
+       if (mtd_device_register(mtd, NULL, 0))
                return -EIO;
-       }
 
        return 0;
 }
 
        struct phram_mtd_list *this, *safe;
 
        list_for_each_entry_safe(this, safe, &phram_list, list) {
-               del_mtd_device(&this->mtd);
+               mtd_device_unregister(&this->mtd);
                iounmap(this->mtd.priv);
                kfree(this->mtd.name);
                kfree(this);
        new->mtd.writesize = 1;
 
        ret = -EAGAIN;
-       if (add_mtd_device(&new->mtd)) {
+       if (mtd_device_register(&new->mtd, NULL, 0)) {
                pr_err("Failed to register new device\n");
                goto out2;
        }
 
                mtd->writesize = 1;
                mtd->owner = THIS_MODULE;
 
-               if (add_mtd_device(mtd)) {
+               if (mtd_device_register(mtd, NULL, 0)) {
                        printk(KERN_NOTICE "pmc551: Failed to register new device\n");
                        pci_iounmap(PCI_Device, priv->start);
                        kfree(mtd->priv);
                        break;
                }
 
-               /* Keep a reference as the add_mtd_device worked */
+               /* Keep a reference as the mtd_device_register worked */
                pci_dev_get(PCI_Device);
 
                printk(KERN_NOTICE "Registered pmc551 memory device.\n");
                pci_dev_put(priv->dev);
 
                kfree(mtd->priv);
-               del_mtd_device(mtd);
+               mtd_device_unregister(mtd);
                kfree(mtd);
                found++;
        }
 
        (*curmtd)->mtdinfo->erasesize = SLRAM_BLK_SZ;
        (*curmtd)->mtdinfo->writesize = 1;
 
-       if (add_mtd_device((*curmtd)->mtdinfo)) {
+       if (mtd_device_register((*curmtd)->mtdinfo, NULL, 0))   {
                E("slram: Failed to register new device\n");
                iounmap(((slram_priv_t *)(*curmtd)->mtdinfo->priv)->start);
                kfree((*curmtd)->mtdinfo->priv);
 
        while (slram_mtdlist) {
                nextitem = slram_mtdlist->next;
-               del_mtd_device(slram_mtdlist->mtdinfo);
+               mtd_device_unregister(slram_mtdlist->mtdinfo);
                iounmap(((slram_priv_t *)slram_mtdlist->mtdinfo->priv)->start);
                kfree(slram_mtdlist->mtdinfo->priv);
                kfree(slram_mtdlist->mtdinfo);
 
                if (map->rsrc.parent) {
                        release_resource(&map->rsrc);
                }
-               del_mtd_device(map->mtd);
+               mtd_device_unregister(map->mtd);
                map_destroy(map->mtd);
                list_del(&map->list);
                kfree(map);
 
                /* Now that the mtd devices is complete claim and export it */
                map->mtd->owner = THIS_MODULE;
-               if (add_mtd_device(map->mtd)) {
+               if (mtd_device_register(map->mtd, NULL, 0)) {
                        map_destroy(map->mtd);
                        map->mtd = NULL;
                        goto out;
 
        sram_mtd->owner = THIS_MODULE;
        sram_mtd->erasesize = 16;
 
-       if (add_mtd_device(sram_mtd)) {
+       if (mtd_device_register(sram_mtd, NULL, 0)) {
                printk("NV-RAM device addition failed\n");
                err = -ENOMEM;
                goto out_probe;
 static void __exit cleanup_autcpu12_maps(void)
 {
        if (sram_mtd) {
-               del_mtd_device(sram_mtd);
+               mtd_device_unregister(sram_mtd);
                map_destroy(sram_mtd);
                iounmap((void *)autcpu12_sram_map.virt);
        }
 
                goto err_probe;
        }
 
-       return add_mtd_partitions(bcm963xx_mtd_info, parsed_parts,
-                                               parsed_nr_parts);
+       return mtd_device_register(bcm963xx_mtd_info, parsed_parts,
+                                  parsed_nr_parts);
 
 err_probe:
        iounmap(bcm963xx_map.virt);
 static int bcm963xx_remove(struct platform_device *pdev)
 {
        if (bcm963xx_mtd_info) {
-               del_mtd_partitions(bcm963xx_mtd_info);
+               mtd_device_unregister(bcm963xx_mtd_info);
                map_destroy(bcm963xx_mtd_info);
        }
 
 
 
        flash_mtd->owner = THIS_MODULE;
 
-       if (add_mtd_device(flash_mtd)) {
+       if (mtd_device_register(flash_mtd, NULL, 0)) {
                printk("FLASH device addition failed\n");
                err = -ENOMEM;
                goto out_probe;
        sram_mtd->owner = THIS_MODULE;
        sram_mtd->erasesize = 16;
 
-       if (add_mtd_device(sram_mtd)) {
+       if (mtd_device_register(sram_mtd, NULL, 0)) {
                printk("SRAM device addition failed\n");
                err = -ENOMEM;
                goto out_probe;
        bootrom_mtd->owner = THIS_MODULE;
        bootrom_mtd->erasesize = 0x10000;
 
-       if (add_mtd_device(bootrom_mtd)) {
+       if (mtd_device_register(bootrom_mtd, NULL, 0)) {
                printk("BootROM device addition failed\n");
                err = -ENOMEM;
                goto out_probe;
 static void __exit cleanup_cdb89712_maps(void)
 {
        if (sram_mtd) {
-               del_mtd_device(sram_mtd);
+               mtd_device_unregister(sram_mtd);
                map_destroy(sram_mtd);
                iounmap((void *)cdb89712_sram_map.virt);
                release_resource (&cdb89712_sram_resource);
        }
 
        if (flash_mtd) {
-               del_mtd_device(flash_mtd);
+               mtd_device_unregister(flash_mtd);
                map_destroy(flash_mtd);
                iounmap((void *)cdb89712_flash_map.virt);
                release_resource (&cdb89712_flash_resource);
        }
 
        if (bootrom_mtd) {
-               del_mtd_device(bootrom_mtd);
+               mtd_device_unregister(bootrom_mtd);
                map_destroy(bootrom_mtd);
                iounmap((void *)cdb89712_bootrom_map.virt);
                release_resource (&cdb89712_bootrom_resource);
 
 {
        int i;
 
-       del_mtd_partitions(mtd);
+       mtd_device_unregister(mtd);
 
        if (mtd != clps[0].mtd)
                mtd_concat_destroy(mtd);
        if (nr_parts == 0) {
                printk(KERN_NOTICE "clps flash: no partition info "
                        "available, registering whole flash\n");
-               add_mtd_device(mtd);
+               mtd_device_register(mtd, NULL, 0);
        } else {
                printk(KERN_NOTICE "clps flash: using %s partition "
                        "definition\n", part_type);
-               add_mtd_partitions(mtd, parsed_parts, nr_parts);
+               mtd_device_register(mtd, parsed_parts, nr_parts);
        }
 
        /* Always succeeds. */
 
        mymtd = do_map_probe("cfi_probe", &flagadm_map);
        if (mymtd) {
                mymtd->owner = THIS_MODULE;
-               add_mtd_partitions(mymtd, flagadm_parts, PARTITION_COUNT);
+               mtd_device_register(mymtd, flagadm_parts, PARTITION_COUNT);
                printk(KERN_NOTICE "FlagaDM flash device initialized\n");
                return 0;
        }
 static void __exit cleanup_flagadm(void)
 {
        if (mymtd) {
-               del_mtd_partitions(mymtd);
+               mtd_device_unregister(mymtd);
                map_destroy(mymtd);
        }
        if (flagadm_map.virt) {
 
                if (map->rsrc.parent)
                        release_resource(&map->rsrc);
 
-               del_mtd_device(map->mtd);
+               mtd_device_unregister(map->mtd);
                map_destroy(map->mtd);
                list_del(&map->list);
                kfree(map);
 
                /* Now that the mtd devices is complete claim and export it */
                map->mtd->owner = THIS_MODULE;
-               if (add_mtd_device(map->mtd)) {
+               if (mtd_device_register(map->mtd, NULL, 0)) {
                        map_destroy(map->mtd);
                        map->mtd = NULL;
                        goto out;
 
                mymtd->owner = THIS_MODULE;
 
                 /* Create MTD devices for each partition. */
-               add_mtd_partitions(mymtd, partition_info, NUM_PARTITIONS);
+               mtd_device_register(mymtd, partition_info, NUM_PARTITIONS);
 
                return 0;
        }
 static void __exit cleanup_dbox2_flash(void)
 {
        if (mymtd) {
-               del_mtd_partitions(mymtd);
+               mtd_device_unregister(mymtd);
                map_destroy(mymtd);
        }
        if (dbox2_flash_map.virt) {
 
        partition_info[2].mtdp = &lowlvl_parts[1];
        partition_info[3].mtdp = &lowlvl_parts[3];
 
-       add_mtd_partitions(mymtd, partition_info, NUM_PARTITIONS);
+       mtd_device_register(mymtd, partition_info, NUM_PARTITIONS);
 
        /*
        ** now create a virtual MTD device by concatenating the for partitions
                ** we do not supply mtd pointers in higlvl_partition_info, so
                ** add_mtd_partitions() will register the devices.
                */
-               add_mtd_partitions(merged_mtd, higlvl_partition_info, NUM_HIGHLVL_PARTITIONS);
+               mtd_device_register(merged_mtd, higlvl_partition_info,
+                                   NUM_HIGHLVL_PARTITIONS);
        }
 
        return 0;
 static void __exit cleanup_dnpc(void)
 {
        if(merged_mtd) {
-               del_mtd_partitions(merged_mtd);
+               mtd_device_unregister(merged_mtd);
                mtd_concat_destroy(merged_mtd);
        }
 
        if (mymtd) {
-               del_mtd_partitions(mymtd);
+               mtd_device_unregister(mymtd);
                map_destroy(mymtd);
        }
        if (dnpc_map.virt) {
 
                   this_mtd->size >> 20, FLASH_BASE_ADDR);
 
        this_mtd->owner = THIS_MODULE;
-       add_mtd_partitions(this_mtd, partitions, num_parts);
+       mtd_device_register(this_mtd, partitions, num_parts);
 
        return 0;
 }
 {
        if (this_mtd)
        {
-               del_mtd_partitions(this_mtd);
+               mtd_device_unregister(this_mtd);
                map_destroy(this_mtd);
        }
 
 
        list_for_each_entry_safe(map, scratch, &window->maps, list) {
                if (map->rsrc.parent)
                        release_resource(&map->rsrc);
-               del_mtd_device(map->mtd);
+               mtd_device_unregister(map->mtd);
                map_destroy(map->mtd);
                list_del(&map->list);
                kfree(map);
 
                /* Now that the mtd devices is complete claim and export it */
                map->mtd->owner = THIS_MODULE;
-               if (add_mtd_device(map->mtd)) {
+               if (mtd_device_register(map->mtd, NULL, 0)) {
                        map_destroy(map->mtd);
                        map->mtd = NULL;
                        goto out;
 
                                        &map_regions[ix].map_info);
                        }
                        map_regions[ix].mymtd->owner = THIS_MODULE;
-                       add_mtd_partitions(map_regions[ix].mymtd,
-                               map_regions[ix].parts,map_regions_parts[ix]);
+                       mtd_device_register(map_regions[ix].mymtd,
+                                           map_regions[ix].parts,
+                                           map_regions_parts[ix]);
                }
        }
        if(iy)
                {
                        if( map_regions[ix].mymtd )
                        {
-                               del_mtd_partitions( map_regions[ix].mymtd );
+                               mtd_device_unregister(map_regions[ix].mymtd);
                                map_destroy( map_regions[ix].mymtd );
                        }
                        iounmap((void *)map_regions[ix].map_info.virt);
 
        list_for_each_entry_safe(map, scratch, &window->maps, list) {
                if (map->rsrc.parent)
                        release_resource(&map->rsrc);
-               del_mtd_device(map->mtd);
+               mtd_device_unregister(map->mtd);
                map_destroy(map->mtd);
                list_del(&map->list);
                kfree(map);
 
                /* Now that the mtd devices is complete claim and export it */
                map->mtd->owner = THIS_MODULE;
-               if (add_mtd_device(map->mtd)) {
+               if (mtd_device_register(map->mtd, NULL, 0)) {
                        map_destroy(map->mtd);
                        map->mtd = NULL;
                        goto out;
 
 
        err = parse_mtd_partitions(info->mtd, probes, &info->parts, 0);
        if (err > 0) {
-               err = add_mtd_partitions(info->mtd, info->parts, err);
+               err = mtd_device_register(info->mtd, info->parts, err);
                if (err)
                        printk(KERN_ERR
                               "mtd partition registration failed: %d\n", err);
         */
  cleanup:
        if (info->mtd) {
-               del_mtd_partitions(info->mtd);
+               mtd_device_unregister(info->mtd);
                if (info->mtd != info->subdev[0].mtd)
                        mtd_concat_destroy(info->mtd);
        }
 
        if (info) {
                if (info->mtd) {
-                       del_mtd_partitions(info->mtd);
+                       mtd_device_unregister(info->mtd);
                        if (info->mtd != info->subdev[0].mtd)
                                mtd_concat_destroy(info->mtd);
                }
 
        if (mymtd) {
                mymtd->owner = THIS_MODULE;
 
-               add_mtd_device(mymtd);
+               mtd_device_register(mymtd, NULL, 0);
                return 0;
        }
 
 
 static void __exit cleanup_l440gx(void)
 {
-       del_mtd_device(mymtd);
+       mtd_device_unregister(mymtd);
        map_destroy(mymtd);
 
        iounmap(l440gx_map.virt);
 
        mymtd = do_map_probe("jedec_probe", &mbx_map);
        if (mymtd) {
                mymtd->owner = THIS_MODULE;
-               add_mtd_device(mymtd);
-                add_mtd_partitions(mymtd, partition_info, NUM_PARTITIONS);
+               mtd_device_register(mymtd, NULL, 0);
+               mtd_device_register(mymtd, partition_info, NUM_PARTITIONS);
                return 0;
        }
 
 static void __exit cleanup_mbx(void)
 {
        if (mymtd) {
-               del_mtd_device(mymtd);
+               mtd_device_unregister(mymtd);
                map_destroy(mymtd);
        }
        if (mbx_map.virt) {
 
        }
 
        mymtd->owner = THIS_MODULE;
-       add_mtd_partitions( mymtd, partition_info, NUM_PARTITIONS );
+       mtd_device_register(mymtd, partition_info, NUM_PARTITIONS);
        return 0;
 }
 
 static void __exit cleanup_netsc520(void)
 {
        if (mymtd) {
-               del_mtd_partitions(mymtd);
+               mtd_device_unregister(mymtd);
                map_destroy(mymtd);
        }
        if (netsc520_map.virt) {
 
                /* No BIOS regions when AMD boot */
                num_intel_partitions -= 2;
        }
-       rc = add_mtd_partitions(intel_mtd, nettel_intel_partitions,
-               num_intel_partitions);
+       rc = mtd_device_register(intel_mtd, nettel_intel_partitions,
+                                num_intel_partitions);
 #endif
 
        if (amd_mtd) {
-               rc = add_mtd_partitions(amd_mtd, nettel_amd_partitions,
-                       num_amd_partitions);
+               rc = mtd_device_register(amd_mtd, nettel_amd_partitions,
+                                        num_amd_partitions);
        }
 
 #ifdef CONFIG_MTD_CFI_INTELEXT
        unregister_reboot_notifier(&nettel_notifier_block);
 #endif
        if (amd_mtd) {
-               del_mtd_partitions(amd_mtd);
+               mtd_device_unregister(amd_mtd);
                map_destroy(amd_mtd);
        }
        if (nettel_mmcrp) {
        }
 #ifdef CONFIG_MTD_CFI_INTELEXT
        if (intel_mtd) {
-               del_mtd_partitions(intel_mtd);
+               mtd_device_unregister(intel_mtd);
                map_destroy(intel_mtd);
        }
        if (nettel_intel_map.virt) {
 
        int i;
        for (i=0; i<2; i++) {
                if (oct5066_mtd[i]) {
-                       del_mtd_device(oct5066_mtd[i]);
+                       mtd_device_unregister(oct5066_mtd[i]);
                        map_destroy(oct5066_mtd[i]);
                }
        }
                        oct5066_mtd[i] = do_map_probe("map_rom", &oct5066_map[i]);
                if (oct5066_mtd[i]) {
                        oct5066_mtd[i]->owner = THIS_MODULE;
-                       add_mtd_device(oct5066_mtd[i]);
+                       mtd_device_register(oct5066_mtd[i], NULL, 0);
                }
        }
 
 
                goto release;
 
        mtd->owner = THIS_MODULE;
-       add_mtd_device(mtd);
+       mtd_device_register(mtd, NULL, 0);
 
        pci_set_drvdata(dev, mtd);
 
        struct mtd_info *mtd = pci_get_drvdata(dev);
        struct map_pci_info *map = mtd->priv;
 
-       del_mtd_device(mtd);
+       mtd_device_unregister(mtd);
        map_destroy(mtd);
        map->exit(dev, map);
        kfree(map);
 
                dev->pcmcia_map.copy_to = pcmcia_copy_to;
        }
 
-       if(add_mtd_device(mtd)) {
+       if (mtd_device_register(mtd, NULL, 0)) {
                map_destroy(mtd);
                dev->mtd_info = NULL;
                dev_err(&dev->p_dev->dev,
        DEBUG(3, "link=0x%p", link);
 
        if(dev->mtd_info) {
-               del_mtd_device(dev->mtd_info);
+               mtd_device_unregister(dev->mtd_info);
                dev_info(&dev->p_dev->dev, "mtd%d: Removing\n",
                         dev->mtd_info->index);
                map_destroy(dev->mtd_info);
 
                msp_flash[i] = do_map_probe("cfi_probe", &msp_maps[i]);
                if (msp_flash[i]) {
                        msp_flash[i]->owner = THIS_MODULE;
-                       add_mtd_partitions(msp_flash[i], msp_parts[i], pcnt);
+                       mtd_device_register(msp_flash[i], msp_parts[i], pcnt);
                } else {
                        printk(KERN_ERR "map probe failed for flash\n");
                        ret = -ENXIO;
 
 cleanup_loop:
        while (i--) {
-               del_mtd_partitions(msp_flash[i]);
+               mtd_device_unregister(msp_flash[i]);
                map_destroy(msp_flash[i]);
                kfree(msp_maps[i].name);
                iounmap(msp_maps[i].virt);
        int i;
 
        for (i = 0; i < fcnt; i++) {
-               del_mtd_partitions(msp_flash[i]);
+               mtd_device_unregister(msp_flash[i]);
                map_destroy(msp_flash[i]);
                iounmap((void *)msp_maps[i].virt);
 
 
        mymtd = do_map_probe("cfi_probe", &rpxlite_map);
        if (mymtd) {
                mymtd->owner = THIS_MODULE;
-               add_mtd_device(mymtd);
+               mtd_device_register(mymtd, NULL, 0);
                return 0;
        }
 
 static void __exit cleanup_rpxlite(void)
 {
        if (mymtd) {
-               del_mtd_device(mymtd);
+               mtd_device_unregister(mymtd);
                map_destroy(mymtd);
        }
        if (rpxlite_map.virt) {
 
 static void cleanup_sbc_gxx(void)
 {
        if( all_mtd ) {
-               del_mtd_partitions( all_mtd );
+               mtd_device_unregister(all_mtd);
                map_destroy( all_mtd );
        }
 
        all_mtd->owner = THIS_MODULE;
 
        /* Create MTD devices for each partition. */
-       add_mtd_partitions(all_mtd, partition_info, NUM_PARTITIONS );
+       mtd_device_register(all_mtd, partition_info, NUM_PARTITIONS);
 
        return 0;
 }
 
                /* Combine the two flash banks into a single MTD device & register it: */
                merged_mtd = mtd_concat_create(mymtd, 2, "SC520CDP Flash Banks #0 and #1");
                if(merged_mtd)
-                       add_mtd_device(merged_mtd);
+                       mtd_device_register(merged_mtd, NULL, 0);
        }
        if(devices_found == 3) /* register the third (DIL-Flash) device */
-               add_mtd_device(mymtd[2]);
+               mtd_device_register(mymtd[2], NULL, 0);
        return(devices_found ? 0 : -ENXIO);
 }
 
        int i;
 
        if (merged_mtd) {
-               del_mtd_device(merged_mtd);
+               mtd_device_unregister(merged_mtd);
                mtd_concat_destroy(merged_mtd);
        }
        if (mymtd[2])
-               del_mtd_device(mymtd[2]);
+               mtd_device_unregister(mymtd[2]);
 
        for (i = 0; i < NUM_FLASH_BANKS; i++) {
                if (mymtd[i])
 
 
        scb2_mtd->owner = THIS_MODULE;
        if (scb2_fixup_mtd(scb2_mtd) < 0) {
-               del_mtd_device(scb2_mtd);
+               mtd_device_unregister(scb2_mtd);
                map_destroy(scb2_mtd);
                iounmap(scb2_ioaddr);
                if (!region_fail)
               (unsigned long long)scb2_mtd->size,
               (unsigned long long)(SCB2_WINDOW - scb2_mtd->size));
 
-       add_mtd_device(scb2_mtd);
+       mtd_device_register(scb2_mtd, NULL, 0);
 
        return 0;
 }
        if (scb2_mtd->lock)
                scb2_mtd->lock(scb2_mtd, 0, scb2_mtd->size);
 
-       del_mtd_device(scb2_mtd);
+       mtd_device_unregister(scb2_mtd);
        map_destroy(scb2_mtd);
 
        iounmap(scb2_ioaddr);
 
        eprom_mtd = do_map_probe("map_rom", &soleng_eprom_map);
        if (eprom_mtd) {
                eprom_mtd->owner = THIS_MODULE;
-               add_mtd_device(eprom_mtd);
+               mtd_device_register(eprom_mtd, NULL, 0);
        }
 
        nr_parts = parse_mtd_partitions(flash_mtd, probes, &parsed_parts, 0);
 #endif /* CONFIG_MTD_SUPERH_RESERVE */
 
        if (nr_parts > 0)
-               add_mtd_partitions(flash_mtd, parsed_parts, nr_parts);
+               mtd_device_register(flash_mtd, parsed_parts, nr_parts);
        else
-               add_mtd_device(flash_mtd);
+               mtd_device_register(flash_mtd, NULL, 0);
 
        return 0;
 }
 static void __exit cleanup_soleng_maps(void)
 {
        if (eprom_mtd) {
-               del_mtd_device(eprom_mtd);
+               mtd_device_unregister(eprom_mtd);
                map_destroy(eprom_mtd);
        }
 
        if (parsed_parts)
-               del_mtd_partitions(flash_mtd);
+               mtd_device_unregister(flash_mtd);
        else
-               del_mtd_device(flash_mtd);
+               mtd_device_unregister(flash_mtd);
        map_destroy(flash_mtd);
 }
 
 
 
        up->mtd->owner = THIS_MODULE;
 
-       add_mtd_device(up->mtd);
+       mtd_device_register(up->mtd, NULL, 0);
 
        dev_set_drvdata(&op->dev, up);
 
        struct uflash_dev *up = dev_get_drvdata(&op->dev);
 
        if (up->mtd) {
-               del_mtd_device(up->mtd);
+               mtd_device_unregister(up->mtd);
                map_destroy(up->mtd);
        }
        if (up->map.virt) {
 
        }
 
        mymtd->owner = THIS_MODULE;
-       add_mtd_partitions(mymtd, ts5500_partitions, NUM_PARTITIONS);
+       mtd_device_register(mymtd, ts5500_partitions, NUM_PARTITIONS);
 
        return 0;
 
 static void __exit cleanup_ts5500_map(void)
 {
        if (mymtd) {
-               del_mtd_partitions(mymtd);
+               mtd_device_unregister(mymtd);
                map_destroy(mymtd);
        }
 
 
        struct mtd_info *mtd;
        mtd = tsunami_flash_mtd;
        if (mtd) {
-               del_mtd_device(mtd);
+               mtd_device_unregister(mtd);
                map_destroy(mtd);
        }
        tsunami_flash_mtd = 0;
        }
        if (tsunami_flash_mtd) {
                tsunami_flash_mtd->owner = THIS_MODULE;
-               add_mtd_device(tsunami_flash_mtd);
+               mtd_device_register(tsunami_flash_mtd, NULL, 0);
                return 0;
        }
        return -ENXIO;
 
 
        for (i=0; i<2; i++) {
                if (vmax_mtd[i]) {
-                       del_mtd_device(vmax_mtd[i]);
+                       mtd_device_unregister(vmax_mtd[i]);
                        map_destroy(vmax_mtd[i]);
                }
        }
                        vmax_mtd[i] = do_map_probe("map_rom", &vmax_map[i]);
                if (vmax_mtd[i]) {
                        vmax_mtd[i]->owner = THIS_MODULE;
-                       add_mtd_device(vmax_mtd[i]);
+                       mtd_device_register(vmax_mtd[i], NULL, 0);
                }
        }
 
 
                goto fail_cache_create;
        part_cur->pcache = pcache;
 
-       error = add_mtd_device(mtd_cur);
+       error = mtd_device_register(mtd_cur, NULL, 0);
        if (error)
                goto fail_mtd_register;
 
        for (x = 0; x < card->partitions; x++) {
                mpart = ((card->mtd)[x]).priv;
                mpart->mdev = NULL;
-               del_mtd_device(&((card->mtd)[x]));
+               mtd_device_unregister(&((card->mtd)[x]));
                kfree(((card->parts)[x]).name);
        }
        kfree(card->parts);
 
                nr_parts = parse_mtd_partitions(sbcmtd[i], part_probes,
                                                &sbcmtd_parts[i], 0);
                if (nr_parts > 0) {
-                       add_mtd_partitions (sbcmtd[i], sbcmtd_parts[i], nr_parts);
+                       mtd_device_register(sbcmtd[i], sbcmtd_parts[i],
+                                           nr_parts);
                        continue;
                }
 
                /* No partitioning detected. Use default */
                if (i == 2) {
-                       add_mtd_device(sbcmtd[i]);
+                       mtd_device_register(sbcmtd[i], NULL, 0);
                } else if (i == bigflash) {
-                       add_mtd_partitions (sbcmtd[i], bigflash_parts, ARRAY_SIZE(bigflash_parts));
+                       mtd_device_register(sbcmtd[i], bigflash_parts,
+                                           ARRAY_SIZE(bigflash_parts));
                } else {
-                       add_mtd_partitions (sbcmtd[i], smallflash_parts, ARRAY_SIZE(smallflash_parts));
+                       mtd_device_register(sbcmtd[i], smallflash_parts,
+                                           ARRAY_SIZE(smallflash_parts));
                }
        }
        return 0;
                        continue;
 
                if (i<2 || sbcmtd_parts[i])
-                       del_mtd_partitions(sbcmtd[i]);
+                       mtd_device_unregister(sbcmtd[i]);
                else
-                       del_mtd_device(sbcmtd[i]);
+                       mtd_device_unregister(sbcmtd[i]);
 
                kfree(sbcmtd_parts[i]);
                map_destroy(sbcmtd[i]);
 
        struct alauda *al = container_of(kref, struct alauda, kref);
 
        if (al->mtd) {
-               del_mtd_device(al->mtd);
+               mtd_device_unregister(al->mtd);
                kfree(al->mtd);
        }
        usb_put_dev(al->dev);
        mtd->priv = al;
        mtd->owner = THIS_MODULE;
 
-       err = add_mtd_device(mtd);
+       err = mtd_device_register(mtd, NULL, 0);
        if (err) {
                err = -ENFILE;
                goto error;
 
        }
 
        /* Register the partitions */
-       add_mtd_partitions(ams_delta_mtd, partition_info,
-                          ARRAY_SIZE(partition_info));
+       mtd_device_register(ams_delta_mtd, partition_info,
+                           ARRAY_SIZE(partition_info));
 
        goto out;
 
 
        }
 
        /* Register the partitions */
-       add_mtd_partitions(au1550_mtd, partition_info, ARRAY_SIZE(partition_info));
+       mtd_device_register(au1550_mtd, partition_info,
+                           ARRAY_SIZE(partition_info));
 
        return 0;
 
 
        /* Register the partitions */
        switch (autcpu12_mtd->size) {
                case SZ_16M:
-                       add_mtd_partitions(autcpu12_mtd, partition_info16k,
-                                          NUM_PARTITIONS16K);
+                       mtd_device_register(autcpu12_mtd, partition_info16k,
+                                           NUM_PARTITIONS16K);
                        break;
                case SZ_32M:
-                       add_mtd_partitions(autcpu12_mtd, partition_info32k,
-                                          NUM_PARTITIONS32K);
+                       mtd_device_register(autcpu12_mtd, partition_info32k,
+                                           NUM_PARTITIONS32K);
                        break;
                case SZ_64M:
-                       add_mtd_partitions(autcpu12_mtd, partition_info64k,
-                                          NUM_PARTITIONS64K);
+                       mtd_device_register(autcpu12_mtd, partition_info64k,
+                                           NUM_PARTITIONS64K);
                        break;
                case SZ_128M:
-                       add_mtd_partitions(autcpu12_mtd, partition_info128k,
-                                          NUM_PARTITIONS128K);
+                       mtd_device_register(autcpu12_mtd, partition_info128k,
+                                           NUM_PARTITIONS128K);
                        break;
                default:
                        printk("Unsupported SmartMedia device\n");
 
 
        /* Register the partitions */
        pr_notice("Using %s partition definition\n", part_type);
-       ret = add_mtd_partitions(cmx270_nand_mtd, mtd_parts, mtd_parts_nb);
+       ret = mtd_device_register(cmx270_nand_mtd, mtd_parts, mtd_parts_nb);
        if (ret)
                goto err_scan;
 
 
                goto failed_req_irq;
        }
 
-       ret = add_mtd_device(&denali->mtd);
+       ret = mtd_device_register(&denali->mtd, NULL, 0);
        if (ret) {
                dev_err(&dev->dev, "Spectra: Failed to register MTD: %d\n",
                                ret);
        struct denali_nand_info *denali = pci_get_drvdata(dev);
 
        nand_release(&denali->mtd);
-       del_mtd_device(&denali->mtd);
+       mtd_device_unregister(&denali->mtd);
 
        denali_irq_cleanup(dev->irq, denali);
 
 
                gpiomtd->plat.adjust_parts(&gpiomtd->plat,
                                           gpiomtd->mtd_info.size);
 
-       add_mtd_partitions(&gpiomtd->mtd_info, gpiomtd->plat.parts,
-                          gpiomtd->plat.num_parts);
+       mtd_device_register(&gpiomtd->mtd_info, gpiomtd->plat.parts,
+                           gpiomtd->plat.num_parts);
        platform_set_drvdata(dev, gpiomtd);
 
        return 0;
 
                goto err_exit;
 
        /* Register NAND partitions */
-       if ((retval = add_mtd_partitions(nsmtd, &nand->partitions[0], nand->nbparts)) != 0)
+       retval = mtd_device_register(nsmtd, &nand->partitions[0],
+                                    nand->nbparts);
+       if (retval != 0)
                goto err_exit;
 
         return 0;
 
                goto fail3;
        }
 
-       add_mtd_partitions(&(nuc900_nand->mtd), partitions,
-                                               ARRAY_SIZE(partitions));
+       mtd_device_register(&(nuc900_nand->mtd), partitions,
+                           ARRAY_SIZE(partitions));
 
        platform_set_drvdata(pdev, nuc900_nand);
 
 
                goto out_lpc;
        }
 
-       if (add_mtd_device(pasemi_nand_mtd)) {
+       if (mtd_device_register(pasemi_nand_mtd, NULL, 0)) {
                printk(KERN_ERR "pasemi_nand: Unable to register MTD device\n");
                err = -ENODEV;
                goto out_lpc;
 
 #endif
 
        /* Register the partitions */
-       ret = add_mtd_partitions(rtc_from4_mtd, partition_info, NUM_PARTITIONS);
+       ret = mtd_device_register(rtc_from4_mtd, partition_info,
+                                 NUM_PARTITIONS);
        if (ret)
                goto err_3;
 
 
        if (ret)
                goto err;
 
-       add_mtd_partitions(flctl_mtd, pdata->parts, pdata->nr_parts);
+       mtd_device_register(flctl_mtd, pdata->parts, pdata->nr_parts);
 
        return 0;
 
 
        if (ret)
                return ret;
 
-       return add_mtd_device(mtd);
+       return mtd_device_register(mtd, NULL, 0);
 }
 EXPORT_SYMBOL_GPL(sm_register_device);
 
 
        }
 
        /* Register the partitions */
-       add_mtd_partitions(spia_mtd, partition_info, NUM_PARTITIONS);
+       mtd_device_register(spia_mtd, partition_info, NUM_PARTITIONS);
 
        /* Return happy */
        return 0;
 
                return -ENXIO;
        }
 
-       add_mtd_partitions(&info->mtd, info->parts, ARRAY_SIZE(os_partitions));
+       mtd_device_register(&info->mtd, info->parts,
+                           ARRAY_SIZE(os_partitions));
 
        return 0;
 }
 
                        vi->vol_id);
        mutex_unlock(&devices_mutex);
 
-       if (add_mtd_device(mtd)) {
+       if (mtd_device_register(mtd, NULL, 0)) {
                err_msg("cannot add MTD device");
                kfree(mtd->name);
                kfree(gluebi);
                return err;
 
        mtd = &gluebi->mtd;
-       err = del_mtd_device(mtd);
+       err = mtd_device_unregister(mtd);
        if (err) {
                err_msg("cannot remove fake MTD device %d, UBI device %d, "
                        "volume %d, error %d", mtd->index, gluebi->ubi_num,
                int err;
                struct mtd_info *mtd = &gluebi->mtd;
 
-               err = del_mtd_device(mtd);
+               err = mtd_device_unregister(mtd);
                if (err)
                        err_msg("error %d while removing gluebi MTD device %d, "
                                "UBI device %d, volume %d - ignoring", err,
 
        int rc;
 
        for (;;) {
-               rc = del_mtd_device(&part->mtd);
+               rc = mtd_device_unregister(&part->mtd);
                if (rc != -EBUSY)
                        break;
                ssleep(1);
                part->mtd.write = efx_mtd->ops->write;
                part->mtd.sync = efx_mtd_sync;
 
-               if (add_mtd_device(&part->mtd))
+               if (mtd_device_register(&part->mtd, NULL, 0))
                        goto fail;
        }
 
                --part;
                efx_mtd_remove_partition(part);
        }
-       /* add_mtd_device() returns 1 if the MTD table is full */
+       /* mtd_device_register() returns 1 if the MTD table is full */
        return -ENOMEM;
 }