summaryrefslogtreecommitdiff
path: root/drivers/char/bfin-otp.c
diff options
context:
space:
mode:
authorPrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>2016-08-25 20:00:50 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-08-31 15:12:35 +0300
commitd6a38c0ba778abd6683858bfd7c768f7edab2ebb (patch)
treec551509f81466432748179919b33775292e24abc /drivers/char/bfin-otp.c
parentca75d601b5942e8cf5eed68f308be0526d0dac5d (diff)
downloadlinux-d6a38c0ba778abd6683858bfd7c768f7edab2ebb.tar.xz
miscdevice: Use module_misc_device() macro
This patch removes module_init()/module_exit() from driver code by using module_misc_device() macro. All modules in this patch has a print statement which is removed when module_misc_device() macro is used. If undesirable this patch can be dropped entirely, this is the only purpose of making this as a separate patch. Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/char/bfin-otp.c')
-rw-r--r--drivers/char/bfin-otp.c40
1 files changed, 1 insertions, 39 deletions
diff --git a/drivers/char/bfin-otp.c b/drivers/char/bfin-otp.c
index 44660f1c4849..35d46da754d7 100644
--- a/drivers/char/bfin-otp.c
+++ b/drivers/char/bfin-otp.c
@@ -230,45 +230,7 @@ static struct miscdevice bfin_otp_misc_device = {
.name = DRIVER_NAME,
.fops = &bfin_otp_fops,
};
-
-/**
- * bfin_otp_init - Initialize module
- *
- * Registers the device and notifier handler. Actual device
- * initialization is handled by bfin_otp_open().
- */
-static int __init bfin_otp_init(void)
-{
- int ret;
-
- stampit();
-
- ret = misc_register(&bfin_otp_misc_device);
- if (ret) {
- pr_init(KERN_ERR PFX "unable to register a misc device\n");
- return ret;
- }
-
- pr_init(KERN_INFO PFX "initialized\n");
-
- return 0;
-}
-
-/**
- * bfin_otp_exit - Deinitialize module
- *
- * Unregisters the device and notifier handler. Actual device
- * deinitialization is handled by bfin_otp_close().
- */
-static void __exit bfin_otp_exit(void)
-{
- stampit();
-
- misc_deregister(&bfin_otp_misc_device);
-}
-
-module_init(bfin_otp_init);
-module_exit(bfin_otp_exit);
+module_misc_device(bfin_otp_misc_device);
MODULE_AUTHOR("Mike Frysinger <vapier@gentoo.org>");
MODULE_DESCRIPTION("Blackfin OTP Memory Interface");