mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Staging: comedi: kcomedilib: Add module_init/exit function
@ 2016-12-05 16:57 Cheah Kok Cheong
  2016-12-05 17:24 ` Ian Abbott
  0 siblings, 1 reply; 2+ messages in thread
From: Cheah Kok Cheong @ 2016-12-05 16:57 UTC (permalink / raw)
  To: hsweeten, abbotti, gregkh; +Cc: devel, linux-kernel, 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.

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Staging: comedi: kcomedilib: Add module_init/exit function
  2016-12-05 16:57 [PATCH] Staging: comedi: kcomedilib: Add module_init/exit function Cheah Kok Cheong
@ 2016-12-05 17:24 ` Ian Abbott
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Abbott @ 2016-12-05 17:24 UTC (permalink / raw)
  To: Cheah Kok Cheong, hsweeten, gregkh; +Cc: devel, linux-kernel

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/  )=-

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-12-05 17:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-05 16:57 [PATCH] Staging: comedi: kcomedilib: Add module_init/exit function Cheah Kok Cheong
2016-12-05 17:24 ` Ian Abbott

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome