summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDejin Zheng <zhengdejin5@gmail.com>2021-02-14 00:45:57 +0800
committerMiquel Raynal <miquel.raynal@bootlin.com>2021-03-11 09:37:48 +0100
commitb1f9604f4d2aa4ca211e48b00feb5b831bd46982 (patch)
tree1922ade0c3e2f9511ef2f1b7385a3663422f8801
parent27b08bf3c3387b064dceedb34e8add7bb159386d (diff)
mtd: mtdblock_ro: Use module_mtd_blktrans to register driver
Removing some boilerplate by using module_mtd_blktrans instead of calling register and unregister in the otherwise empty init/exit functions. Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20210213164600.409061-6-zhengdejin5@gmail.com
-rw-r--r--drivers/mtd/mtdblock_ro.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/drivers/mtd/mtdblock_ro.c b/drivers/mtd/mtdblock_ro.c
index 7fcf29ef2bdc..d92914f73d52 100644
--- a/drivers/mtd/mtdblock_ro.c
+++ b/drivers/mtd/mtdblock_ro.c
@@ -67,18 +67,7 @@ static struct mtd_blktrans_ops mtdblock_tr = {
.owner = THIS_MODULE,
};
-static int __init mtdblock_init(void)
-{
- return register_mtd_blktrans(&mtdblock_tr);
-}
-
-static void __exit mtdblock_exit(void)
-{
- deregister_mtd_blktrans(&mtdblock_tr);
-}
-
-module_init(mtdblock_init);
-module_exit(mtdblock_exit);
+module_mtd_blktrans(mtdblock_tr);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");