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:
committed by
David Woodhouse
parent
6b57c11601
commit
ee0e87b174
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user