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
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user