mtd: convert remaining users to mtd_device_register()

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>
This commit is contained in:
Jamie Iles
2011-05-23 10:23:40 +01:00
committed by David Woodhouse
parent 6b57c11601
commit ee0e87b174
60 changed files with 160 additions and 150 deletions

View 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])