mtd: convert remaining users to mtd_device_register()
authorJamie Iles <jamie@jamieiles.com>
Mon, 23 May 2011 09:23:40 +0000 (10:23 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 25 May 2011 01:25:00 +0000 (02:25 +0100)
The older add_mtd_device()/add_mtd_partitions() and their removal
counterparts will soon be gone.  Replace uses with mtd_device_register()
and mtd_device_unregister().

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>
60 files changed:
drivers/mtd/devices/block2mtd.c
drivers/mtd/devices/doc2000.c
drivers/mtd/devices/doc2001.c
drivers/mtd/devices/doc2001plus.c
drivers/mtd/devices/lart.c
drivers/mtd/devices/ms02-nv.c
drivers/mtd/devices/mtdram.c
drivers/mtd/devices/phram.c
drivers/mtd/devices/pmc551.c
drivers/mtd/devices/slram.c
drivers/mtd/maps/amd76xrom.c
drivers/mtd/maps/autcpu12-nvram.c
drivers/mtd/maps/bcm963xx-flash.c
drivers/mtd/maps/cdb89712.c
drivers/mtd/maps/ceiva.c
drivers/mtd/maps/cfi_flagadm.c
drivers/mtd/maps/ck804xrom.c
drivers/mtd/maps/dbox2-flash.c
drivers/mtd/maps/dilnetpc.c
drivers/mtd/maps/dmv182.c
drivers/mtd/maps/esb2rom.c
drivers/mtd/maps/fortunet.c
drivers/mtd/maps/ichxrom.c
drivers/mtd/maps/integrator-flash.c
drivers/mtd/maps/l440gx.c
drivers/mtd/maps/mbx860.c
drivers/mtd/maps/netsc520.c
drivers/mtd/maps/nettel.c
drivers/mtd/maps/octagon-5066.c
drivers/mtd/maps/pci.c
drivers/mtd/maps/pcmciamtd.c
drivers/mtd/maps/pmcmsp-flash.c
drivers/mtd/maps/rpxlite.c
drivers/mtd/maps/sbc_gxx.c
drivers/mtd/maps/sc520cdp.c
drivers/mtd/maps/scb2_flash.c
drivers/mtd/maps/solutionengine.c
drivers/mtd/maps/sun_uflash.c
drivers/mtd/maps/ts5500_flash.c
drivers/mtd/maps/tsunami_flash.c
drivers/mtd/maps/vmax301.c
drivers/mtd/maps/vmu-flash.c
drivers/mtd/maps/wr_sbc82xx_flash.c
drivers/mtd/nand/alauda.c
drivers/mtd/nand/ams-delta.c
drivers/mtd/nand/au1550nd.c
drivers/mtd/nand/autcpu12.c
drivers/mtd/nand/cmx270_nand.c
drivers/mtd/nand/denali.c
drivers/mtd/nand/gpio.c
drivers/mtd/nand/nandsim.c
drivers/mtd/nand/nuc900_nand.c
drivers/mtd/nand/pasemi_nand.c
drivers/mtd/nand/rtc_from4.c
drivers/mtd/nand/sh_flctl.c
drivers/mtd/nand/sm_common.c
drivers/mtd/nand/spia.c
drivers/mtd/onenand/onenand_sim.c
drivers/mtd/ubi/gluebi.c
drivers/net/sfc/mtd.c

index 97183c8c9e338cc22bc8979d91f4a32cd3723447..b78f23169d4e7dce23848eba02b7cf9b8f6cd43f 100644 (file)
@@ -294,7 +294,7 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size)
        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;
        }
@@ -465,7 +465,7 @@ static void __devexit block2mtd_exit(void)
        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);
index 5bf5f460e1327828c203710ffee7041044fb14b2..f7fbf6025ef286de5f7fc61c1d3eada86695073f 100644 (file)
@@ -597,7 +597,7 @@ void DoC2k_init(struct mtd_info *mtd)
                doc2klist = mtd;
                mtd->size = this->totlen;
                mtd->erasesize = this->erasesize;
-               add_mtd_device(mtd);
+               mtd_device_register(mtd, NULL, 0);
                return;
        }
 }
@@ -1185,7 +1185,7 @@ static void __exit cleanup_doc2000(void)
                this = mtd->priv;
                doc2klist = this->nextdoc;
 
-               del_mtd_device(mtd);
+               mtd_device_unregister(mtd);
 
                iounmap(this->virtadr);
                kfree(this->chips);
index 0990f7803628605fba21b083c0e426ae2697628c..241192f05bc8d2cb8bcc601f2c61b06cd815274e 100644 (file)
@@ -376,7 +376,7 @@ void DoCMil_init(struct mtd_info *mtd)
                this->nextdoc = docmillist;
                docmillist = mtd;
                mtd->size  = this->totlen;
-               add_mtd_device(mtd);
+               mtd_device_register(mtd, NULL, 0);
                return;
        }
 }
@@ -826,7 +826,7 @@ static void __exit cleanup_doc2001(void)
                this = mtd->priv;
                docmillist = this->nextdoc;
 
-               del_mtd_device(mtd);
+               mtd_device_unregister(mtd);
 
                iounmap(this->virtadr);
                kfree(this->chips);
index 8b36fa77a195840f273062e355b4c1706340133e..09ae0adc3ad07be984d9b936d9eda7fe24e0e86d 100644 (file)
@@ -499,7 +499,7 @@ void DoCMilPlus_init(struct mtd_info *mtd)
                docmilpluslist = mtd;
                mtd->size  = this->totlen;
                mtd->erasesize = this->erasesize;
-               add_mtd_device(mtd);
+               mtd_device_register(mtd, NULL, 0);
                return;
        }
 }
@@ -1091,7 +1091,7 @@ static void __exit cleanup_doc2001plus(void)
                this = mtd->priv;
                docmilpluslist = this->nextdoc;
 
-               del_mtd_device(mtd);
+               mtd_device_unregister(mtd);
 
                iounmap(this->virtadr);
                kfree(this->chips);
index 4b829f97d56cfe313292d68480ea5eabb675a28d..772a0ff89e0f7e316279d82632d0893ad89b0f64 100644 (file)
@@ -684,9 +684,10 @@ static int __init lart_flash_init (void)
 #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);
@@ -695,9 +696,9 @@ static int __init lart_flash_init (void)
 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
 }
 
index 6a9a24a80a6d206a573fea039a8a0274b389db4d..8423fb6d4f26b05df635ee14608e654599627fc7 100644 (file)
@@ -220,7 +220,7 @@ static int __init ms02nv_init_one(ulong addr)
        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;
@@ -262,7 +262,7 @@ static void __exit ms02nv_remove_one(void)
 
        root_ms02nv_mtd = mp->next;
 
-       del_mtd_device(mtd);
+       mtd_device_unregister(mtd);
 
        release_resource(mp->resource.csr);
        kfree(mp->resource.csr);
index 1483e18971cef934b0c713fe9e5ab5727561cf12..2562689ba6b47d185edd5c3ba862af50a8ae97a8 100644 (file)
@@ -104,7 +104,7 @@ static int ram_write(struct mtd_info *mtd, loff_t to, size_t len,
 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);
        }
@@ -133,9 +133,8 @@ int mtdram_init_device(struct mtd_info *mtd, void *mapped_address,
        mtd->read = ram_read;
        mtd->write = ram_write;
 
-       if (add_mtd_device(mtd)) {
+       if (mtd_device_register(mtd, NULL, 0))
                return -EIO;
-       }
 
        return 0;
 }
index 8d28fa02a5a2f13d342c196be185ba4e88b68452..23423bd00b069da5266d72cbfa6353f21ec775dd 100644 (file)
@@ -115,7 +115,7 @@ static void unregister_devices(void)
        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);
@@ -153,7 +153,7 @@ static int register_device(char *name, unsigned long start, unsigned long len)
        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;
        }
index 41b8cdcc64cbf4184bf7d9bfb4b16b14cb7b9356..ecff765579dd395bbb73bacecd8b54bf375c7ee6 100644 (file)
@@ -798,7 +798,7 @@ static int __init init_pmc551(void)
                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);
@@ -806,7 +806,7 @@ static int __init init_pmc551(void)
                        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");
@@ -856,7 +856,7 @@ static void __exit cleanup_pmc551(void)
                pci_dev_put(priv->dev);
 
                kfree(mtd->priv);
-               del_mtd_device(mtd);
+               mtd_device_unregister(mtd);
                kfree(mtd);
                found++;
        }
index 592016a0668f9d9672393b48fa8cd3d9cb5f4443..e585263161b949ee1b863725ae627f6a4595fc7f 100644 (file)
@@ -210,7 +210,7 @@ static int register_device(char *name, unsigned long start, unsigned long length
        (*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);
@@ -231,7 +231,7 @@ static void unregister_devices(void)
 
        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);
index 92de7e3a49a5e3b1c6c0590c8c3687cdebd1c132..e2875d6fe129d81645e449e5fc685f5e4a60b3c8 100644 (file)
@@ -82,7 +82,7 @@ static void amd76xrom_cleanup(struct amd76xrom_window *window)
                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);
@@ -262,7 +262,7 @@ static int __devinit amd76xrom_init_one (struct pci_dev *pdev,
 
                /* 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;
index 53664188fc471c1ecd03952abc7b044129ea16cb..e5bfd0e093bb1e20e0336f84e69eb7058dc7a822 100644 (file)
@@ -88,7 +88,7 @@ map:
        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;
@@ -111,7 +111,7 @@ out:
 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);
        }
index 1f3049590d9e0b80c6296c835c13b45224cb17dc..608967fe74c63b73c74268bed8306b1bba6a2079 100644 (file)
@@ -224,8 +224,8 @@ probe_ok:
                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);
@@ -235,7 +235,7 @@ err_probe:
 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);
        }
 
index 8d92d8db9a98c0a3c5625ce74fd27a4268070ba4..c29cbf87ea0c9ea3279161c76bd0ee254cb5fd50 100644 (file)
@@ -75,7 +75,7 @@ static int __init init_cdb89712_flash (void)
 
        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;
@@ -141,7 +141,7 @@ static int __init init_cdb89712_sram (void)
        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;
@@ -209,7 +209,7 @@ static int __init init_cdb89712_bootrom (void)
        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;
@@ -249,21 +249,21 @@ static int __init init_cdb89712_maps(void)
 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);
index 23f551dc8ca8f14c2c6751b50eb068d569c7d0af..06f9c98157204c4994fff3528d4da2296500eb49 100644 (file)
@@ -224,7 +224,7 @@ static void __exit clps_destroy_mtd(struct clps_info *clps, struct mtd_info *mtd
 {
        int i;
 
-       del_mtd_partitions(mtd);
+       mtd_device_unregister(mtd);
 
        if (mtd != clps[0].mtd)
                mtd_concat_destroy(mtd);
@@ -292,11 +292,11 @@ static void __init clps_locate_partitions(struct mtd_info *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. */
index f71343cd77cca60f1eef6a46e8088ee1779bba1c..d16fc9d3b8cd5bd58dae35c7f5e579e289ac9083 100644 (file)
@@ -107,7 +107,7 @@ static int __init init_flagadm(void)
        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;
        }
@@ -119,7 +119,7 @@ static int __init init_flagadm(void)
 static void __exit cleanup_flagadm(void)
 {
        if (mymtd) {
-               del_mtd_partitions(mymtd);
+               mtd_device_unregister(mymtd);
                map_destroy(mymtd);
        }
        if (flagadm_map.virt) {
index 5fdb7b26cea3e836e517dda937ab92fb72f6e0e4..3d0e762fa5f2ed5b0c306cdb3fb22373fa565962 100644 (file)
@@ -94,7 +94,7 @@ static void ck804xrom_cleanup(struct ck804xrom_window *window)
                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);
@@ -291,7 +291,7 @@ static int __devinit ck804xrom_init_one (struct pci_dev *pdev,
 
                /* 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;
index cfacfa6f45ddd8708801765b5a35aff10dabec45..85bdece6ab3f281788e11f81fb9822c4b02e1fef 100644 (file)
@@ -93,7 +93,7 @@ static int __init init_dbox2_flash(void)
                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;
        }
@@ -105,7 +105,7 @@ static int __init init_dbox2_flash(void)
 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) {
index 0713e3a5a22cb4b4bf1baa1db4c5d57d01259e13..3e393f0da823cada1906598f31187e177c89479d 100644 (file)
@@ -450,7 +450,7 @@ static int __init init_dnpc(void)
        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
@@ -463,7 +463,8 @@ static int __init init_dnpc(void)
                ** 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;
@@ -472,12 +473,12 @@ static int __init init_dnpc(void)
 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) {
index d171674eb2ed1ec17ee73a0c63a4bdb034e576d7..6538ac675e008b9dbd2c41436e5273763d5354b6 100644 (file)
@@ -120,7 +120,7 @@ static int __init init_svme182(void)
                   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;
 }
@@ -129,7 +129,7 @@ static void __exit cleanup_svme182(void)
 {
        if (this_mtd)
        {
-               del_mtd_partitions(this_mtd);
+               mtd_device_unregister(this_mtd);
                map_destroy(this_mtd);
        }
 
index 4feb7507ab7c9a4906f66a735a176668e665656a..08322b1c3e8149220de252005ed477e624f60e5d 100644 (file)
@@ -128,7 +128,7 @@ static void esb2rom_cleanup(struct esb2rom_window *window)
        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);
@@ -352,7 +352,7 @@ static int __devinit esb2rom_init_one(struct pci_dev *pdev,
 
                /* 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;
index 1e43124d498bc1cd2a685ad099db3713f136394f..956e2e4f30ea687b666fd4e41dd8225142c8d144 100644 (file)
@@ -243,8 +243,9 @@ static int __init init_fortunet(void)
                                        &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)
@@ -261,7 +262,7 @@ static void __exit cleanup_fortunet(void)
                {
                        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);
index 1337a4191a0cc3a8086049c308d14abab25622a3..6689dcb3124d5d30cca8c1c2554fc4b40c8c485e 100644 (file)
@@ -67,7 +67,7 @@ static void ichxrom_cleanup(struct ichxrom_window *window)
        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);
@@ -287,7 +287,7 @@ static int __devinit ichxrom_init_one (struct pci_dev *pdev,
 
                /* 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;
index e22ff5adbbf4b34016d98c82eebaba24e050133d..a97bbcf0d5848c6432dcbf439eeeedd9ed5a2028 100644 (file)
@@ -221,7 +221,7 @@ static int armflash_probe(struct platform_device *dev)
 
        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);
@@ -237,7 +237,7 @@ static int armflash_probe(struct platform_device *dev)
         */
  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);
        }
@@ -263,7 +263,7 @@ static int armflash_remove(struct platform_device *dev)
 
        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);
                }
index 9e054503c4cf2920e23c7fded7d2bd39741c4166..dd0360ba2412b646e27dd05fd11fbe29c37e211a 100644 (file)
@@ -138,7 +138,7 @@ static int __init init_l440gx(void)
        if (mymtd) {
                mymtd->owner = THIS_MODULE;
 
-               add_mtd_device(mymtd);
+               mtd_device_register(mymtd, NULL, 0);
                return 0;
        }
 
@@ -148,7 +148,7 @@ static int __init init_l440gx(void)
 
 static void __exit cleanup_l440gx(void)
 {
-       del_mtd_device(mymtd);
+       mtd_device_unregister(mymtd);
        map_destroy(mymtd);
 
        iounmap(l440gx_map.virt);
index 0eb5a7c853806147092f990162faa2926a60344f..93fa56c33003bf162eeb29b1a351cbe320c7c2fa 100644 (file)
@@ -69,8 +69,8 @@ static int __init init_mbx(void)
        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;
        }
 
@@ -81,7 +81,7 @@ static int __init init_mbx(void)
 static void __exit cleanup_mbx(void)
 {
        if (mymtd) {
-               del_mtd_device(mymtd);
+               mtd_device_unregister(mymtd);
                map_destroy(mymtd);
        }
        if (mbx_map.virt) {
index c0cb319b2b70e26f38f6c9133263098ff245bad0..81dc2598bc0ac9085cadf7b332543e7752be5ade 100644 (file)
@@ -116,14 +116,14 @@ static int __init init_netsc520(void)
        }
 
        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) {
index a97133eb9d70ec8356e991d3a63fb888000d4c31..eadcfffc4f9cae70018c695df0bfae713eae5250 100644 (file)
@@ -383,13 +383,13 @@ static int __init nettel_init(void)
                /* 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
@@ -419,7 +419,7 @@ static void __exit nettel_cleanup(void)
        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) {
@@ -432,7 +432,7 @@ static void __exit nettel_cleanup(void)
        }
 #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) {
index 23fe1786770f140c686215cc05925a5d4f6c2d8d..807ac2a2e686e0b3ecd5e12df39eaa62847c20c4 100644 (file)
@@ -175,7 +175,7 @@ void cleanup_oct5066(void)
        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]);
                }
        }
@@ -220,7 +220,7 @@ static int __init init_oct5066(void)
                        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);
                }
        }
 
index 48f4cf5cb9d1d8f18a31c9f80af75b703d933b21..1d005a3e9b41603856c40a60fee6de972771634f 100644 (file)
@@ -313,7 +313,7 @@ mtd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
                goto release;
 
        mtd->owner = THIS_MODULE;
-       add_mtd_device(mtd);
+       mtd_device_register(mtd, NULL, 0);
 
        pci_set_drvdata(dev, mtd);
 
@@ -336,7 +336,7 @@ mtd_pci_remove(struct pci_dev *dev)
        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);
index 6799e75d74e0387c251200a7e266506a8c59704d..a523e2a6af53547e84d8552a391920b812d71285 100644 (file)
@@ -630,7 +630,7 @@ static int pcmciamtd_config(struct pcmcia_device *link)
                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,
@@ -669,7 +669,7 @@ static void pcmciamtd_detach(struct pcmcia_device *link)
        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);
index 64aea6acd48e5f173e6bd5d628e1d97a3cf1e7d4..744ca5cacc9b2e8b6f10189dc169f29426cad9e9 100644 (file)
@@ -173,7 +173,7 @@ static int __init init_msp_flash(void)
                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;
@@ -188,7 +188,7 @@ static int __init init_msp_flash(void)
 
 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);
@@ -207,7 +207,7 @@ static void __exit cleanup_msp_flash(void)
        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);
 
index 3e3ef53d4fd4cba637d9d378daca278c021809f4..ed88225bf66707aba6412793f3419b055aff19b3 100644 (file)
@@ -36,7 +36,7 @@ static int __init init_rpxlite(void)
        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;
        }
 
@@ -47,7 +47,7 @@ static int __init init_rpxlite(void)
 static void __exit cleanup_rpxlite(void)
 {
        if (mymtd) {
-               del_mtd_device(mymtd);
+               mtd_device_unregister(mymtd);
                map_destroy(mymtd);
        }
        if (rpxlite_map.virt) {
index 04b2781fc6278ba852b47f4e7208f3dc228e6209..556a2dfe94c586e03b363f5c2056992346df72b1 100644 (file)
@@ -182,7 +182,7 @@ static struct mtd_info *all_mtd;
 static void cleanup_sbc_gxx(void)
 {
        if( all_mtd ) {
-               del_mtd_partitions( all_mtd );
+               mtd_device_unregister(all_mtd);
                map_destroy( all_mtd );
        }
 
@@ -223,7 +223,7 @@ static int __init init_sbc_gxx(void)
        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;
 }
index 4d8aaaf4bb761a3325a059e927bab9769ec4a0c4..8fead8e46bce6bad5a72f74c80bda4c592a15cf0 100644 (file)
@@ -266,10 +266,10 @@ static int __init init_sc520cdp(void)
                /* 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);
 }
 
@@ -278,11 +278,11 @@ static void __exit cleanup_sc520cdp(void)
        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])
index 7e329f09a548f06bb83c36c1281d65db2278ef7c..d88c8426bb0fe7a4032fbdd8d3cee879542c59d2 100644 (file)
@@ -180,7 +180,7 @@ scb2_flash_probe(struct pci_dev *dev, const struct pci_device_id *ent)
 
        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)
@@ -192,7 +192,7 @@ scb2_flash_probe(struct pci_dev *dev, const struct pci_device_id *ent)
               (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;
 }
@@ -207,7 +207,7 @@ scb2_flash_remove(struct pci_dev *dev)
        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);
index 0eb41d9c67867fb90280ba0570408e1536b4760e..cbf6bade9354681164e707b2e43924b21a833578 100644 (file)
@@ -89,7 +89,7 @@ static int __init init_soleng_maps(void)
        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);
@@ -104,9 +104,9 @@ static int __init init_soleng_maps(void)
 #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;
 }
@@ -114,14 +114,14 @@ static int __init init_soleng_maps(void)
 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);
 }
 
index 3f1cb328a574dd6e7e01cf47a1c12509f3fc2630..2d66234f57cb471e3c9700b5fc35ad1e1c9b6e5f 100644 (file)
@@ -101,7 +101,7 @@ int uflash_devinit(struct platform_device *op, struct device_node *dp)
 
        up->mtd->owner = THIS_MODULE;
 
-       add_mtd_device(up->mtd);
+       mtd_device_register(up->mtd, NULL, 0);
 
        dev_set_drvdata(&op->dev, up);
 
@@ -126,7 +126,7 @@ static int __devexit uflash_remove(struct platform_device *op)
        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) {
index e02dfa9d4ddd8279890ec3daf1c91c0a0af90190..d1d671daf2356862374691b5a5977754d6828384 100644 (file)
@@ -89,7 +89,7 @@ static int __init init_ts5500_map(void)
        }
 
        mymtd->owner = THIS_MODULE;
-       add_mtd_partitions(mymtd, ts5500_partitions, NUM_PARTITIONS);
+       mtd_device_register(mymtd, ts5500_partitions, NUM_PARTITIONS);
 
        return 0;
 
@@ -102,7 +102,7 @@ err2:
 static void __exit cleanup_ts5500_map(void)
 {
        if (mymtd) {
-               del_mtd_partitions(mymtd);
+               mtd_device_unregister(mymtd);
                map_destroy(mymtd);
        }
 
index 77a8bfc025770b657ae404b814d7e718ea3da005..1de390e1c2fb3039b98100014e21ac2e6563ba4c 100644 (file)
@@ -76,7 +76,7 @@ static void __exit  cleanup_tsunami_flash(void)
        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;
@@ -97,7 +97,7 @@ static int __init init_tsunami_flash(void)
        }
        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;
index 6adaa6acc1936716ad74e063613c84abe7c5d856..5e68de73eabc9b94fce43255806994f5a8f9baaa 100644 (file)
@@ -138,7 +138,7 @@ static void __exit cleanup_vmax301(void)
 
        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]);
                }
        }
@@ -176,7 +176,7 @@ static int __init init_vmax301(void)
                        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);
                }
        }
 
index 4afc167731ef5e980383d0f442c9417ab58494f4..3a04b078576a0aa04ee07afa4fec48c56fe3f43b 100644 (file)
@@ -563,7 +563,7 @@ static void vmu_queryblocks(struct mapleq *mq)
                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;
 
@@ -709,7 +709,7 @@ static void __devexit vmu_disconnect(struct maple_device *mdev)
        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);
index 933a2b6598b46fe44f1935afe3f55ed49f35f521..901ce968efaebc11acf9e9c4e5460dfec7fc3e3d 100644 (file)
@@ -132,17 +132,20 @@ static int __init init_sbc82xx_flash(void)
                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;
@@ -157,9 +160,9 @@ static void __exit cleanup_sbc82xx_flash(void)
                        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]);
index 8691e0482ed28b8886e976c0bee3e1e48cd02c75..eb40ea829ab282b0418d68efd1c8a0f6c0347c9a 100644 (file)
@@ -120,7 +120,7 @@ static void alauda_delete(struct kref *kref)
        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);
@@ -592,7 +592,7 @@ static int alauda_init_media(struct alauda *al)
        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;
index bc65bf71e1a240798f2be57a8668bc971249c5fb..78017eb9318ebc7dbbf4c8269b83b3d0ca924e34 100644 (file)
@@ -235,8 +235,8 @@ static int __devinit ams_delta_init(struct platform_device *pdev)
        }
 
        /* 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;
 
index 3ffe05db4923b662f51adcddb0e62cd1af09a5c8..001545beab9a2a0ffc83349079a66fa017c066ef 100644 (file)
@@ -580,7 +580,8 @@ static int __init au1xxx_nand_init(void)
        }
 
        /* 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;
 
index 0911cf03db806bcaa33e5469732e3158f7eaff77..eddc9a2249859efe157dac13f8042da3afaf26e6 100644 (file)
@@ -185,20 +185,20 @@ static int __init autcpu12_init(void)
        /* 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");
index 6e6495278258f040e51bcfc1e41f6b0f6d45f1d2..6fc043a30d1e20809dccb6d3555ee1603823415e 100644 (file)
@@ -238,7 +238,7 @@ static int __init cmx270_init(void)
 
        /* 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;
 
index 8c5dc89da2d23962cfe6b44c7791428377a7c056..d5276218945fe296cb1c1b8c29cb8f21929dfb42 100644 (file)
@@ -1644,7 +1644,7 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
                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);
@@ -1676,7 +1676,7 @@ static void denali_pci_remove(struct pci_dev *dev)
        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);
 
index 0cde618bcc1e15022612ee0177e02fada244c873..2c2060b2800e38b61252a07c2c417b5069302868 100644 (file)
@@ -316,8 +316,8 @@ static int __devinit gpio_nand_probe(struct platform_device *dev)
                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;
index 893d95bfea481ad9c568a83cea316eb9f06472b8..357e8c5252a8c38df3d8ba3885a7fc948b34303c 100644 (file)
@@ -2383,7 +2383,9 @@ static int __init ns_init_module(void)
                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;
index 6eddf7361ed7c74dd709f51b408a5a976e580832..9c30a0b031715f5d8a26dfd3fb3abbb7418adb6f 100644 (file)
@@ -321,8 +321,8 @@ static int __devinit nuc900_nand_probe(struct platform_device *pdev)
                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);
 
index 20bfe5f15afdcaf7cd93c19d1a296013a0d694f8..b1aa41b8a4eb6cd0d660d7c38eef8d1be00c0190 100644 (file)
@@ -163,7 +163,7 @@ static int __devinit pasemi_nand_probe(struct platform_device *ofdev)
                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;
index 67440b5beef8c7f12567b1f48240d621b66d324f..c9f9127ff7708ee06fae1bd6e159f8e0619f20e5 100644 (file)
@@ -580,7 +580,8 @@ static int __init rtc_from4_init(void)
 #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;
 
index 81bbb5ee148d49da8a9ca792338f60b2c7324b1d..93b1f74321c2a9e7793b8a867a1a02af15638278 100644 (file)
@@ -867,7 +867,7 @@ static int __devinit flctl_probe(struct platform_device *pdev)
        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;
 
index 57cc80cd01a33e8749eaad0201ae561f964339ec..b6332e83b2895e798fc5220dd914b1e1a1e99602 100644 (file)
@@ -139,7 +139,7 @@ int sm_register_device(struct mtd_info *mtd, int smartmedia)
        if (ret)
                return ret;
 
-       return add_mtd_device(mtd);
+       return mtd_device_register(mtd, NULL, 0);
 }
 EXPORT_SYMBOL_GPL(sm_register_device);
 
index 0cc6d0acb8febdcde011545e5022bb950e3ccf0e..bef76cd7c24c08ab7431756017a739c09cd692f9 100644 (file)
@@ -149,7 +149,7 @@ static int __init spia_init(void)
        }
 
        /* 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;
index 5ef3bd5477723dabf1c5b405ceb45b1ae1f2dff6..85399e3accda56205c07211853284cfe70317495 100644 (file)
@@ -539,7 +539,8 @@ static int __init onenand_sim_init(void)
                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;
 }
index 9aa81584c8a29dc4afbbba437613c85b51f60ca8..941bc3c05d6e51232eabfbdd6db08a0248bb4328 100644 (file)
@@ -365,7 +365,7 @@ static int gluebi_create(struct ubi_device_info *di,
                        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);
@@ -407,7 +407,7 @@ static int gluebi_remove(struct ubi_volume_info *vi)
                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,
@@ -524,7 +524,7 @@ static void __exit ubi_gluebi_exit(void)
                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,
index e646bfce2d84933f8f1d43df8344c3d1d3bdc5b8..b6304486f2449437b5825169e06b77ad70ae6a97 100644 (file)
@@ -216,7 +216,7 @@ static void efx_mtd_remove_partition(struct efx_mtd_partition *part)
        int rc;
 
        for (;;) {
-               rc = del_mtd_device(&part->mtd);
+               rc = mtd_device_unregister(&part->mtd);
                if (rc != -EBUSY)
                        break;
                ssleep(1);
@@ -268,7 +268,7 @@ static int efx_mtd_probe_device(struct efx_nic *efx, struct efx_mtd *efx_mtd)
                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;
        }
 
@@ -280,7 +280,7 @@ 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;
 }