mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stelian Pop <stelian@popies.net>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@osdl.org>, Andrew Morton <akpm@osdl.org>
Subject: [PATCH 1/12] meye: module related fixes
Date: Thu, 4 Nov 2004 12:13:22 +0100	[thread overview]
Message-ID: <20041104111322.GG3472@crusoe.alcove-fr> (raw)
In-Reply-To: <20041104111231.GF3472@crusoe.alcove-fr>

===================================================================

ChangeSet@1.2340, 2004-11-02 15:03:36+01:00, stelian@popies.net
  meye: module related fixes
          * use module_param() instead of MODULE_PARM() and __setup()
          * use MODULE_VERSION()
  
  Signed-off-by: Stelian Pop <stelian@popies.net>

===================================================================

 meye.c |   61 ++++++++++++++++++++++---------------------------------------
 meye.h |    3 +++
 2 files changed, 25 insertions(+), 39 deletions(-)

===================================================================

diff -Nru a/drivers/media/video/meye.c b/drivers/media/video/meye.c
--- a/drivers/media/video/meye.c	2004-11-04 11:03:16 +01:00
+++ b/drivers/media/video/meye.c	2004-11-04 11:03:16 +01:00
@@ -39,16 +39,31 @@
 #include <linux/vmalloc.h>
 
 #include "meye.h"
-#include "linux/meye.h"
+#include <linux/meye.h>
+
+MODULE_AUTHOR("Stelian Pop <stelian@popies.net>");
+MODULE_DESCRIPTION("v4l/v4l2 driver for the MotionEye camera");
+MODULE_LICENSE("GPL");
+MODULE_VERSION(MEYE_DRIVER_VERSION);
 
-/* driver structure - only one possible */
-static struct meye meye;
 /* number of grab buffers */
 static unsigned int gbuffers = 2;
+module_param(gbuffers, int, 0444);
+MODULE_PARM_DESC(gbuffers, "number of capture buffers, default is 2 (32 max)");
+
 /* size of a grab buffer */
 static unsigned int gbufsize = MEYE_MAX_BUFSIZE;
+module_param(gbufsize, int, 0444);
+MODULE_PARM_DESC(gbufsize, "size of the capture buffers, default is 614400"
+		 " (will be rounded up to a page multiple)");
+
 /* /dev/videoX registration number */
 static int video_nr = -1;
+module_param(video_nr, int, 0444);
+MODULE_PARM_DESC(video_nr, "video device to register (0=/dev/video0, etc)");
+
+/* driver structure - only one possible */
+static struct meye meye;
 
 /****************************************************************************/
 /* Queue routines                                                           */
@@ -1438,7 +1453,7 @@
 #endif
 };
 
-static int __init meye_init_module(void) {
+static int __init meye_init(void) {
 	if (gbuffers < 2)
 		gbuffers = 2;
 	if (gbuffers > MEYE_MAX_BUFNBRS)
@@ -1450,42 +1465,10 @@
 	return pci_module_init(&meye_driver);
 }
 
-static void __exit meye_cleanup_module(void) {
+static void __exit meye_exit(void) {
 	pci_unregister_driver(&meye_driver);
 }
 
-#ifndef MODULE
-static int __init meye_setup(char *str) {
-	int ints[4];
-
-	str = get_options(str, ARRAY_SIZE(ints), ints);
-	if (ints[0] <= 0) 
-		goto out;
-	gbuffers = ints[1];
-	if (ints[0] == 1)
-		goto out;
-	gbufsize = ints[2];
-	if (ints[0] == 2)
-		goto out;
-	video_nr = ints[3];
-out:
-	return 1;
-}
-
-__setup("meye=", meye_setup);
-#endif
-
-MODULE_AUTHOR("Stelian Pop <stelian@popies.net>");
-MODULE_DESCRIPTION("video4linux driver for the MotionEye camera");
-MODULE_LICENSE("GPL");
-
-MODULE_PARM(gbuffers,"i");
-MODULE_PARM_DESC(gbuffers,"number of capture buffers, default is 2 (32 max)");
-MODULE_PARM(gbufsize,"i");
-MODULE_PARM_DESC(gbufsize,"size of the capture buffers, default is 614400");
-MODULE_PARM(video_nr,"i");
-MODULE_PARM_DESC(video_nr,"video device to register (0=/dev/video0, etc)");
-
 /* Module entry points */
-module_init(meye_init_module);
-module_exit(meye_cleanup_module);
+module_init(meye_init);
+module_exit(meye_exit);
diff -Nru a/drivers/media/video/meye.h b/drivers/media/video/meye.h
--- a/drivers/media/video/meye.h	2004-11-04 11:03:16 +01:00
+++ b/drivers/media/video/meye.h	2004-11-04 11:03:16 +01:00
@@ -33,6 +33,9 @@
 #define MEYE_DRIVER_MAJORVERSION	1
 #define MEYE_DRIVER_MINORVERSION	10
 
+#define MEYE_DRIVER_VERSION __stringify(MEYE_DRIVER_MAJORVERSION) "." \
+			    __stringify(MEYE_DRIVER_MINORVERSION)
+
 #include <linux/config.h>
 #include <linux/types.h>
 #include <linux/pci.h>

  reply	other threads:[~2004-11-04 11:14 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-04 11:12 [PATCH 0/12] meye driver update Stelian Pop
2004-11-04 11:13 ` Stelian Pop [this message]
2004-11-04 11:13 ` [PATCH 2/12] meye: replace homebrew queue with kfifo Stelian Pop
2004-11-04 11:14 ` [PATCH 3/12] meye: picture depth is in bits not in bytes Stelian Pop
2004-11-04 11:14 ` [PATCH 4/12] meye: do lock properly when waiting for buffers Stelian Pop
2004-11-04 11:15 ` [PATCH 5/12] meye: implement non blocking access using poll() Stelian Pop
2004-11-04 11:15 ` [PATCH 6/12] meye: cleanup init/exit paths Stelian Pop
2004-11-04 11:16 ` [PATCH 7/12] meye: the driver is no longer experimental and depends on PCI Stelian Pop
2004-11-04 11:41   ` Christoph Hellwig
2004-11-04 11:49     ` Stelian Pop
2004-11-04 12:23       ` Arjan van de Ven
2004-11-04 12:32         ` Stelian Pop
2004-11-04 13:16           ` Arjan van de Ven
2004-11-04 14:09             ` Stelian Pop
2004-11-04 11:16 ` [PATCH 8/12] meye: module parameters documentation fixes Stelian Pop
2004-11-04 11:17 ` [PATCH 9/12] meye: add v4l2 support Stelian Pop
2004-11-04 11:17 ` [PATCH 10/12] meye: whitespace and coding style cleanups Stelian Pop
2004-11-04 11:18 ` [PATCH 11/12] meye: bump up the version number Stelian Pop
2004-11-04 11:18 ` [PATCH 12/12] meye: cache the camera settings in the driver Stelian Pop
2004-11-04 12:25 ` [PATCH 0/12] meye driver update Emmanuel Fleury
2004-11-04 12:36   ` Stelian Pop
2004-11-04 21:19 ` meye bug? (was: meye driver update) Roland Mas
2004-11-04 21:42   ` Roland Mas
2004-11-04 21:58   ` Stelian Pop
2004-11-05 11:18     ` meye bug? No Roland Mas
2004-11-05 22:25       ` Stelian Pop

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041104111322.GG3472@crusoe.alcove-fr \
    --to=stelian@popies.net \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®