patch-2.4.13 linux/drivers/media/video/bw-qcam.c
Next file: linux/drivers/media/video/id.h
Previous file: linux/drivers/media/video/bttvp.h
Back to the patch index
Back to the overall index
- Lines: 60
- Date:
Thu Oct 11 09:14:32 2001
- Orig file:
v2.4.12/linux/drivers/media/video/bw-qcam.c
- Orig date:
Tue Oct 9 17:06:51 2001
diff -u --recursive --new-file v2.4.12/linux/drivers/media/video/bw-qcam.c linux/drivers/media/video/bw-qcam.c
@@ -1,8 +1,6 @@
/*
* QuickCam Driver For Video4Linux.
*
- * This version only works as a module.
- *
* Video4Linux conversion work by Alan Cox.
* Parport compatibility by Phil Blundell.
* Busy loop avoidance by Mark Cooke.
@@ -991,11 +989,20 @@
MODULE_PARM(parport, "1-" __MODULE_STRING(MAX_CAMS) "s");
#endif
-#ifdef MODULE
-int init_module(void)
+static void __exit exit_bw_qcams(void)
+{
+ unsigned int i;
+
+ for (i = 0; i < num_cams; i++)
+ close_bwqcam(qcams[i]);
+}
+
+static int __init init_bw_qcams(void)
{
struct parport *port;
+#ifdef MODULE
int n;
+
if(parport[0] && strncmp(parport[0], "auto", 4)){
/* user gave parport parameters */
for(n=0; parport[n] && n<MAX_CAMS; n++){
@@ -1033,22 +1040,14 @@
}
return (num_cams)?0:-ENODEV;
-}
-
-void cleanup_module(void)
-{
- unsigned int i;
- for (i = 0; i < num_cams; i++)
- close_bwqcam(qcams[i]);
-}
#else
-int __init init_bw_qcams(struct video_init *unused)
-{
- struct parport *port;
-
for (port = parport_enumerate(); port; port=port->next)
init_bwqcam(port);
return 0;
-}
#endif
+}
+
+module_init(init_bw_qcams);
+module_exit(exit_bw_qcams);
+
MODULE_LICENSE("GPL");
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)