[Lkw] [PATCH] nvme-cmb: add init-exit interaction

Geremias Baudino geremiasbaudino at mi.unc.edu.ar
Thu Sep 14 17:45:37 EDT 2023


A simple interaction addition

Signed-off-by: Geremias Baudino geremiasbaudino at mi.unc.edu.ar
---
 drivers/block/nvme-cmb.c | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/block/nvme-cmb.c b/drivers/block/nvme-cmb.c
index ae07a21c9..d4980345c 100644
--- a/drivers/block/nvme-cmb.c
+++ b/drivers/block/nvme-cmb.c
@@ -1,3 +1,19 @@
 #include <linux/module.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
 
-MODULE_LICENSE("GPL");
\ No newline at end of file
+MODULE_LICENSE("GPL");
+
+static int __init nvme_cmb_init(void)
+{
+	pr_info("loading nvme-cmb module\n");
+	return 0;
+}
+
+static void __exit nvme_cmb_exit(void)
+{
+	pr_info("unloading nvme-cmb module\n");
+}
+
+module_init(nvme_cmb_init);
+module_exit(nvme_cmb_exit);
\ No newline at end of file
-- 
2.39.2




More information about the LKW mailing list