Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee0e87b1 authored by Jamie Iles's avatar Jamie Iles Committed by David Woodhouse
Browse files

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: default avatarJamie Iles <jamie@jamieiles.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 6b57c116
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);
+2 −2
Original line number Diff line number Diff line
@@ -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);
+2 −2
Original line number Diff line number Diff line
@@ -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);
+2 −2
Original line number Diff line number Diff line
@@ -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);
+5 −4
Original line number Diff line number Diff line
@@ -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
}

Loading