Skip to contentSkip to conversation

Staging: comedi: kcomedilib: Add module_init/exit function

PATCH In review Cheah Kok Cheong 2 participants 2 messages Dec 5, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: comedi: kcomedilib: Add module_init/exit function

Add init/exit function to follow LKM semantics. Apparently this module can still load/unload without the init/exit function.

Tested loading/unloading with and without this patch.

---
 drivers/staging/comedi/kcomedilib/kcomedilib_main.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/staging/comedi/kcomedilib/kcomedilib_main.c +12 -0
index d0a8a28..55d43c0 100644
@@ -250,3 +250,15 @@ int comedi_get_n_channels(struct comedi_device *dev, unsigned int subdevice)
 	return n;
 }
 EXPORT_SYMBOL_GPL(comedi_get_n_channels);
+
+static int __init kcomedilib_module_init(void)
+{
+	return 0;
+}
+
+static void __exit kcomedilib_module_exit(void)
+{
+}
+
+module_init(kcomedilib_module_init);
+module_exit(kcomedilib_module_exit);
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 22 lines · Cheah Kok Cheong

Add init/exit function to follow LKM semantics. Apparently this module can still load/unload without the init/exit function.

Tested loading/unloading with and without this patch.

---
 drivers/staging/comedi/kcomedilib/kcomedilib_main.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/staging/comedi/kcomedilib/kcomedilib_main.c +2 -0
index d0a8a28..55d43c0 100644
@@ -250,3 +250,15 @@ int comedi_get_n_channels(struct comedi_device *dev, unsigned int subdevice)
 	return n;
 }
 EXPORT_SYMBOL_GPL(comedi_get_n_channels);
+
+static int __init kcomedilib_module_init(void)

drivers/staging/comedi/kcomedilib/kcomedilib_main.c int comedi_get_n_channels(struct comedi_device *dev, unsigned int subdevice) · line 264

Quoted 10 lines
drivers/staging/comedi/kcomedilib/kcomedilib_main.c +10 -0
+{
+	return 0;
+}
+
+static void __exit kcomedilib_module_exit(void)
+{
+}
+
+module_init(kcomedilib_module_init);
+module_exit(kcomedilib_module_exit);

Looks good, thanks!

Signature · 2 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]> )=-
-=(                          Web: http://www.mev.co.uk/  )=-