[Lkw] [PATCH 01/10] nvme-cmb: added minimal functionality on loading and unloading

Damian Gonzalez damian.gonzalez at mi.unc.edu.ar
Fri Sep 15 18:32:48 EDT 2023


Logs the load and unload of the module.

Signed-off-by: Damian Gonzalez <damian.gonzalez at mi.unc.edu.ar>
---
 drivers/block/Makefile   |  2 ++
 drivers/block/nvme-cmb.c | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+)
 create mode 100644 drivers/block/nvme-cmb.c

diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index 101612cba..3ad5dcb18 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -40,3 +40,5 @@ obj-$(CONFIG_BLK_DEV_NULL_BLK)	+= null_blk/
 obj-$(CONFIG_BLK_DEV_UBLK)			+= ublk_drv.o
 
 swim_mod-y	:= swim.o swim_asm.o
+
+obj-m += nvme-cmb.o
diff --git a/drivers/block/nvme-cmb.c b/drivers/block/nvme-cmb.c
new file mode 100644
index 000000000..e11aae5a8
--- /dev/null
+++ b/drivers/block/nvme-cmb.c
@@ -0,0 +1,18 @@
+#include <linux/module.h>
+MODULE_LICENSE("GPL");
+#include <linux/init.h>
+#include <linux/kernel.h>
+
+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);
-- 
2.39.2




More information about the LKW mailing list