Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1536237 > unrolled thread
| Started by | Cheah Kok Cheong <thrust73@gmail.com> |
|---|---|
| First post | 2016-12-05 18:00 +0100 |
| Last post | 2016-12-05 18:40 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] Staging: comedi: kcomedilib: Add module_init/exit function Cheah Kok Cheong <thrust73@gmail.com> - 2016-12-05 18:00 +0100
Re: [PATCH] Staging: comedi: kcomedilib: Add module_init/exit function Ian Abbott <abbotti@mev.co.uk> - 2016-12-05 18:40 +0100
| From | Cheah Kok Cheong <thrust73@gmail.com> |
|---|---|
| Date | 2016-12-05 18:00 +0100 |
| Subject | [PATCH] Staging: comedi: kcomedilib: Add module_init/exit function |
| Message-ID | <sL4Mp-71m-13@gated-at.bofh.it> |
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.
Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
---
drivers/staging/comedi/kcomedilib/kcomedilib_main.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/staging/comedi/kcomedilib/kcomedilib_main.c b/drivers/staging/comedi/kcomedilib/kcomedilib_main.c
index d0a8a28..55d43c0 100644
--- a/drivers/staging/comedi/kcomedilib/kcomedilib_main.c
+++ b/drivers/staging/comedi/kcomedilib/kcomedilib_main.c
@@ -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);
--
2.7.4
[toc] | [next] | [standalone]
| From | Ian Abbott <abbotti@mev.co.uk> |
|---|---|
| Date | 2016-12-05 18:40 +0100 |
| Subject | Re: [PATCH] Staging: comedi: kcomedilib: Add module_init/exit function |
| Message-ID | <sL5p8-7ud-3@gated-at.bofh.it> |
| In reply to | #1536237 |
On 05/12/16 16:57, Cheah Kok Cheong wrote:
> 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.
>
> Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
> ---
> drivers/staging/comedi/kcomedilib/kcomedilib_main.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/staging/comedi/kcomedilib/kcomedilib_main.c b/drivers/staging/comedi/kcomedilib/kcomedilib_main.c
> index d0a8a28..55d43c0 100644
> --- a/drivers/staging/comedi/kcomedilib/kcomedilib_main.c
> +++ b/drivers/staging/comedi/kcomedilib/kcomedilib_main.c
> @@ -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);
>
Looks good, thanks!
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=-
-=( Web: http://www.mev.co.uk/ )=-
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web