sampler: use the common initialization mechanism 32/156732/2
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 19 Oct 2017 17:39:01 +0000 (20:39 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Fri, 20 Oct 2017 11:02:42 +0000 (14:02 +0300)
Change-Id: I80d620161ad52056395336525f785543366f4356
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
modules/sampler/swap_sampler_module.c

index 94cb50665a6d9831d3b8e1588ca511dea27f14fd..9ab9dca6d637f602022aaa627db37312a4380672 100644 (file)
@@ -34,7 +34,7 @@
 #include <linux/notifier.h>
 #include <linux/cpu.h>
 #include <linux/module.h>
-
+#include <master/swap_initializer.h>
 #include "swap_sampler_module.h"
 #include "swap_sampler_errors.h"
 #include "kernel_operations.h"
@@ -174,7 +174,7 @@ unlock:
 }
 EXPORT_SYMBOL_GPL(swap_sampler_stop);
 
-static int __init sampler_init(void)
+static int sampler_init(void)
 {
        int retval;
 
@@ -186,10 +186,10 @@ static int __init sampler_init(void)
 
        print_msg("Sample ininitialization success\n");
 
-       return E_SS_SUCCESS;
+       return 0;
 }
 
-static void __exit sampler_exit(void)
+static void sampler_uninit(void)
 {
        if (sampler_run)
                do_swap_sampler_stop();
@@ -199,8 +199,7 @@ static void __exit sampler_exit(void)
        print_msg("Sampler uninitialized\n");
 }
 
-module_init(sampler_init);
-module_exit(sampler_exit);
+SWAP_LIGHT_INIT_MODULE_CORE(sampler_init, sampler_uninit);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("SWAP sampling module");