diff options
author | PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> | 2016-08-25 13:00:50 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-08-31 08:12:35 -0400 |
commit | d6a38c0ba778abd6683858bfd7c768f7edab2ebb (patch) | |
tree | c551509f81466432748179919b33775292e24abc /drivers/lightnvm/core.c | |
parent | ca75d601b5942e8cf5eed68f308be0526d0dac5d (diff) |
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/lightnvm/core.c')
-rw-r--r-- | drivers/lightnvm/core.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index 9ebd2cfbd849..c784ddcd4405 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c | |||
@@ -1171,27 +1171,10 @@ static struct miscdevice _nvm_misc = { | |||
1171 | .nodename = "lightnvm/control", | 1171 | .nodename = "lightnvm/control", |
1172 | .fops = &_ctl_fops, | 1172 | .fops = &_ctl_fops, |
1173 | }; | 1173 | }; |
1174 | module_misc_device(_nvm_misc); | ||
1174 | 1175 | ||
1175 | MODULE_ALIAS_MISCDEV(MISC_DYNAMIC_MINOR); | 1176 | MODULE_ALIAS_MISCDEV(MISC_DYNAMIC_MINOR); |
1176 | 1177 | ||
1177 | static int __init nvm_mod_init(void) | ||
1178 | { | ||
1179 | int ret; | ||
1180 | |||
1181 | ret = misc_register(&_nvm_misc); | ||
1182 | if (ret) | ||
1183 | pr_err("nvm: misc_register failed for control device"); | ||
1184 | |||
1185 | return ret; | ||
1186 | } | ||
1187 | |||
1188 | static void __exit nvm_mod_exit(void) | ||
1189 | { | ||
1190 | misc_deregister(&_nvm_misc); | ||
1191 | } | ||
1192 | |||
1193 | MODULE_AUTHOR("Matias Bjorling <m@bjorling.me>"); | 1178 | MODULE_AUTHOR("Matias Bjorling <m@bjorling.me>"); |
1194 | MODULE_LICENSE("GPL v2"); | 1179 | MODULE_LICENSE("GPL v2"); |
1195 | MODULE_VERSION("0.1"); | 1180 | MODULE_VERSION("0.1"); |
1196 | module_init(nvm_mod_init); | ||
1197 | module_exit(nvm_mod_exit); | ||