On Wed, Nov 13, 2002 at 09:44:32AM -0800, Joe Burks wrote:
> This is the same patch as before, without the checks for CONFIG_PROC_FS.
> 
> Greg, please apply

Oops, sorry, I just realized that I had added this patch to my tree, but
not the one I sent to Linus, so it didn't end up in 2.5.48.  Very sorry.
I just now added it, and added the patch below, which fixes up a number
of things (including a error if you didn't have CONFIG_VIDEO_PROC_FS
enabled).

Again, sorry about that.

greg k-h



diff -Nru a/drivers/usb/media/vicam.c b/drivers/usb/media/vicam.c
--- a/drivers/usb/media/vicam.c Mon Nov 18 17:04:01 2002
+++ b/drivers/usb/media/vicam.c Mon Nov 18 17:04:01 2002
@@ -44,14 +44,6 @@
 
 // #define VICAM_DEBUG
 
-#ifndef MODULE_LICENSE
-#define MODULE_LICENSE(a)
-#endif
-
-#ifndef bool
-#define bool int
-#endif
-
 #ifdef VICAM_DEBUG
 #define ADBG(lineno,fmt,args...) printk(fmt, jiffies, __FUNCTION__, lineno, ##args)
 #define DBG(fmt,args...) ADBG((__LINE__),KERN_DEBUG __FILE__"(%ld):%s 
(%d):"fmt,##args)
@@ -418,10 +410,10 @@
 
        struct semaphore busy_lock;     // guard against SMP multithreading
 
-       bool is_initialized;
+       int is_initialized;
        u8 open_count;
        u8 bulkEndpoint;
-       bool needsDummyRead;
+       int needsDummyRead;
 
 #if defined(CONFIG_VIDEO_PROC_FS)
        struct proc_dir_entry *proc_dir;
@@ -838,7 +830,7 @@
 //   Copyright (C) 2002 Monroe Williams ([EMAIL PROTECTED])
 // --------------------------------------------------------------------------------
 
-void vicam_decode_color( char *data, char *rgb)
+static void vicam_decode_color( char *data, char *rgb)
 {
        int x,y;
        int Cr, Cb;
@@ -1069,7 +1061,7 @@
 
 static struct proc_dir_entry *vicam_proc_root = NULL;
 
-int vicam_read_helper(char *page, char **start, off_t off,
+static int vicam_read_helper(char *page, char **start, off_t off,
                                int count, int *eof, int value)
 {
        char *out = page;
@@ -1090,21 +1082,21 @@
        return len;
 }
 
-int vicam_read_proc_shutter(char *page, char **start, off_t off,
+static int vicam_read_proc_shutter(char *page, char **start, off_t off,
                                int count, int *eof, void *data)
 {
        return vicam_read_helper(page,start,off,count,eof,
                                ((struct vicam_camera *)data)->shutter_speed);
 }
 
-int vicam_read_proc_gain(char *page, char **start, off_t off,
+static int vicam_read_proc_gain(char *page, char **start, off_t off,
                                int count, int *eof, void *data)
 {
        return vicam_read_helper(page,start,off,count,eof,
                                ((struct vicam_camera *)data)->gain);
 }
 
-int vicam_write_proc_shutter(struct file *file, const char *buffer,
+static int vicam_write_proc_shutter(struct file *file, const char *buffer,
                                unsigned long count, void *data)
 {
        struct vicam_camera *cam = (struct vicam_camera *)data;
@@ -1114,7 +1106,7 @@
        return count;
 }
 
-int vicam_write_proc_gain(struct file *file, const char *buffer,
+static int vicam_write_proc_gain(struct file *file, const char *buffer,
                                unsigned long count, void *data)
 {
        struct vicam_camera *cam = (struct vicam_camera *)data;
@@ -1126,7 +1118,7 @@
 
 
 
-void
+static void
 vicam_create_proc_root(void)
 {
        vicam_proc_root = create_proc_entry("video/vicam", S_IFDIR, 0);
@@ -1138,14 +1130,14 @@
                       "could not create /proc entry for vicam!");
 }
 
-void
+static void
 vicam_destroy_proc_root(void)
 {
        if (vicam_proc_root)
                remove_proc_entry("video/vicam", 0);
 }
 
-void
+static void
 vicam_create_proc_entry(struct vicam_camera *cam)
 {
        char name[64];
@@ -1186,7 +1178,7 @@
        }
 }
 
-void
+static void
 vicam_destroy_proc_entry(void *ptr)
 {
        struct vicam_camera *cam = (struct vicam_camera *) ptr;
@@ -1203,6 +1195,11 @@
 
 }
 
+#else
+static inline void vicam_create_proc_root(void) { }
+static inline void vicam_destroy_proc_root(void) { }
+static inline void vicam_create_proc_entry(struct vicam_camera *cam) { }
+static inline void vicam_destroy_proc_entry(void *ptr) { }
 #endif
 
 static struct file_operations vicam_fops = {
@@ -1323,9 +1320,7 @@
        
        video_unregister_device(&cam->vdev);
 
-#if defined(CONFIG_VIDEO_PROC_FS)
        vicam_destroy_proc_entry(cam);
-#endif
 
        kfree(cam);
 
@@ -1338,9 +1333,7 @@
 usb_vicam_init(void)
 {
        DBG(KERN_INFO "ViCam-based WebCam driver startup\n");
-#if defined(CONFIG_VIDEO_PROC_FS)
        vicam_create_proc_root();
-#endif
        if (usb_register(&vicam_driver) != 0)
                printk(KERN_WARNING "usb_register failed!\n");
        return 0;
@@ -1353,9 +1346,7 @@
               "ViCam-based WebCam driver shutdown\n");
 
        usb_deregister(&vicam_driver);
-#if defined(CONFIG_VIDEO_PROC_FS)
        vicam_destroy_proc_root();
-#endif
 }
 
 module_init(usb_vicam_init);


-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing 
your web site with SSL, click here to get a FREE TRIAL of a Thawte 
Server Certificate: http://www.gothawte.com/rd524.html
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to