summaryrefslogtreecommitdiffstats
path: root/fs/pstore/platform.c
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2018-10-18 11:17:42 -0700
committerKees Cook <keescook@chromium.org>2018-10-22 07:11:58 -0700
commitcb095afd44768bf495894b9ad063bd078e4bb201 (patch)
tree60305776bfe4f5bb50f9df1527893f04b7f2a016 /fs/pstore/platform.c
parent57361846b52bc686112da6ca5368d11210796804 (diff)
downloadlinux-cb095afd44768bf495894b9ad063bd078e4bb201.tar.gz
linux-cb095afd44768bf495894b9ad063bd078e4bb201.tar.bz2
linux-cb095afd44768bf495894b9ad063bd078e4bb201.zip
pstore: Centralize init/exit routines
In preparation for having additional actions during init/exit, this moves the init/exit into platform.c, centralizing the logic to make call outs to the fs init/exit. Signed-off-by: Kees Cook <keescook@chromium.org> Tested-by: Guenter Roeck <groeck@chromium.org>
Diffstat (limited to 'fs/pstore/platform.c')
-rw-r--r--fs/pstore/platform.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 15e99d5a681d..d61e26812af6 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -780,8 +780,31 @@ void __init pstore_choose_compression(void)
}
}
+static int __init pstore_init(void)
+{
+ int ret;
+
+ pstore_choose_compression();
+
+ ret = pstore_init_fs();
+ if (ret)
+ return ret;
+
+ return 0;
+}
+module_init(pstore_init)
+
+static void __exit pstore_exit(void)
+{
+ pstore_exit_fs();
+}
+module_exit(pstore_exit)
+
module_param(compress, charp, 0444);
MODULE_PARM_DESC(compress, "Pstore compression to use");
module_param(backend, charp, 0444);
MODULE_PARM_DESC(backend, "Pstore backend to use");
+
+MODULE_AUTHOR("Tony Luck <tony.luck@intel.com>");
+MODULE_LICENSE("GPL");