Skip to content

Commit

Permalink
mtd: mtdblock_ro: Use module_mtd_blktrans to register driver
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Miquel Raynal <[email protected]>
Link: https://lore.kernel.org/linux-mtd/[email protected]
  • Loading branch information
Dejin Zheng authored and miquelraynal committed Mar 11, 2021
1 parent 27b08bf commit b1f9604
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions drivers/mtd/mtdblock_ro.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>");
Expand Down

0 comments on commit b1f9604

Please sign in to comment.