[Lkw] [PATCH] Fix filename and add more functions
Emmanuel Arias
eamanu at riseup.net
Thu Sep 14 17:55:11 EDT 2023
Fix the filename from nvme.cmb.c to nvm-cmb.c it was a typo. Also Fix
the Makefile, also a new typo obj-n instead of obj-m.
Also add nvme_cmb_init and nvme_cmb_exit functions to the module.
Signed-off-by: Emmanuel Arias <eamanu at riseup.net>
---
drivers/block/Makefile | 2 +-
drivers/block/nvme-cmb.c | 18 ++++++++++++++++++
drivers/block/nvme.cmb.c | 2 --
3 files changed, 19 insertions(+), 3 deletions(-)
create mode 100644 drivers/block/nvme-cmb.c
delete mode 100644 drivers/block/nvme.cmb.c
diff --git a/drivers/block/Makefile b/drivers/block/Makefile
index e4181968e..a3d5a3c70 100644
--- a/drivers/block/Makefile
+++ b/drivers/block/Makefile
@@ -39,6 +39,6 @@ obj-$(CONFIG_BLK_DEV_NULL_BLK) += null_blk/
obj-$(CONFIG_BLK_DEV_UBLK) += ublk_drv.o
-obj-n += nvme-cmb.o
+obj-m += nvme-cmb.o
swim_mod-y := swim.o swim_asm.o
diff --git a/drivers/block/nvme-cmb.c b/drivers/block/nvme-cmb.c
new file mode 100644
index 000000000..ae2f4f542
--- /dev/null
+++ b/drivers/block/nvme-cmb.c
@@ -0,0 +1,18 @@
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+
+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);
diff --git a/drivers/block/nvme.cmb.c b/drivers/block/nvme.cmb.c
deleted file mode 100644
index 00214af27..000000000
--- a/drivers/block/nvme.cmb.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#include <linux/module.h>
-MODULE_LICENSE("GPL");
--
2.39.2
More information about the LKW
mailing list