ChangeSet 1.1276.1.50, 2003/08/27 17:23:00-07:00, greg@kroah.com [PATCH] USB: removed the proc code from the se401.c driver This removes the compiler warning. drivers/usb/media/se401.c | 145 ---------------------------------------------- drivers/usb/media/se401.h | 3 2 files changed, 148 deletions(-) diff -Nru a/drivers/usb/media/se401.c b/drivers/usb/media/se401.c --- a/drivers/usb/media/se401.c Tue Sep 2 12:43:27 2003 +++ b/drivers/usb/media/se401.c Tue Sep 2 12:43:27 2003 @@ -30,16 +30,10 @@ #include #include #include -#include #include #include -#include #include #include -#include -#include -#include - #include "se401.h" static int flickerless=0; @@ -126,131 +120,6 @@ /**************************************************************************** * - * /proc interface - * - ***************************************************************************/ - -#warning please convert me from procfs to sysfs -#undef CONFIG_VIDEO_PROC_FS - -#if defined(CONFIG_PROC_FS) && defined(CONFIG_VIDEO_PROC_FS) - -static struct proc_dir_entry *se401_proc_entry = NULL; -extern struct proc_dir_entry *video_proc_entry; - -#define YES_NO(x) ((x) ? "yes" : "no") - -static int se401_read_proc(char *page, char **start, off_t off, int count, - int *eof, void *data) -{ - char *out = page; - int i, len; - struct usb_se401 *se401 = data; - - /* Stay under PAGE_SIZE or else bla bla bla.... */ - - out+=sprintf(out, "driver_version : %s\n", version); - out+=sprintf(out, "model : %s\n", se401->camera_name); - out+=sprintf(out, "in use : %s\n", YES_NO (se401->user)); - out+=sprintf(out, "streaming : %s\n", YES_NO (se401->streaming)); - out+=sprintf(out, "button state : %s\n", YES_NO (se401->button)); - out+=sprintf(out, "button pressed : %s\n", YES_NO (se401->buttonpressed)); - out+=sprintf(out, "num_frames : %d\n", SE401_NUMFRAMES); - - out+=sprintf(out, "Sizes :"); - for (i=0; isizes; i++) { - out+=sprintf(out, " %dx%d", se401->width[i], - se401->height[i]); - } - out+=sprintf(out, "\n"); - - out+=sprintf(out, "Frames total : %d\n", se401->readcount); - out+=sprintf(out, "Frames read : %d\n", se401->framecount); - out+=sprintf(out, "Packets dropped : %d\n", se401->dropped); - out+=sprintf(out, "Decoding Errors : %d\n", se401->error); - - len = out - page; - len -= off; - if (len < count) { - *eof = 1; - if (len <= 0) - return 0; - } else - len = count; - - *start = page + off; - - return len; -} - -static int se401_write_proc(struct file *file, const char *buffer, - unsigned long count, void *data) -{ - return -EINVAL; -} - -static void create_proc_se401_cam (struct usb_se401 *se401) -{ - char name[7]; - struct proc_dir_entry *ent; - - if (!se401_proc_entry || !se401) - return; - - sprintf (name, "video%d", se401->vdev.minor); - - ent = create_proc_entry(name, S_IFREG | S_IRUGO | S_IWUSR, - se401_proc_entry); - - if (!ent) - return; - - ent->data = se401; - ent->read_proc = se401_read_proc; - ent->write_proc = se401_write_proc; - se401->proc_entry = ent; -} - -static void destroy_proc_se401_cam (struct usb_se401 *se401) -{ - /* One to much, just to be sure :) */ - char name[9]; - - if (!se401 || !se401->proc_entry) - return; - - sprintf(name, "video%d", se401->vdev.minor); - remove_proc_entry(name, se401_proc_entry); - se401->proc_entry = NULL; -} - -static void proc_se401_create (void) -{ - if (video_proc_entry == NULL) { - err("/proc/video/ doesn't exist"); - return; - } - - se401_proc_entry=create_proc_entry("se401", S_IFDIR, video_proc_entry); - - if (se401_proc_entry) - se401_proc_entry->owner = THIS_MODULE; - else - err("Unable to initialize /proc/video/se401"); -} - -static void proc_se401_destroy(void) -{ - if (se401_proc_entry == NULL) - return; - - remove_proc_entry("se401", video_proc_entry); -} -#endif /* CONFIG_PROC_FS && CONFIG_VIDEO_PROC_FS */ - - -/**************************************************************************** - * * se401 register read/write functions * ***************************************************************************/ @@ -1517,9 +1386,6 @@ err("video_register_device failed"); return -EIO; } -#if defined(CONFIG_PROC_FS) && defined(CONFIG_VIDEO_PROC_FS) - create_proc_se401_cam(se401); -#endif info("registered new video device: video%d", se401->vdev.minor); usb_set_intfdata (intf, se401); @@ -1544,9 +1410,6 @@ wake_up_interruptible(&se401->wq); se401->removed = 1; } -#if defined(CONFIG_PROC_FS) && defined(CONFIG_VIDEO_PROC_FS) - destroy_proc_se401_cam(se401); -#endif } } @@ -1568,10 +1431,6 @@ static int __init usb_se401_init(void) { -#if defined(CONFIG_PROC_FS) && defined(CONFIG_VIDEO_PROC_FS) - proc_se401_create(); -#endif - info("SE401 usb camera driver version %s registering", version); if (flickerless) if (flickerless!=50 && flickerless!=60) { @@ -1585,10 +1444,6 @@ { usb_deregister(&se401_driver); info("SE401 driver deregistered"); - -#if defined(CONFIG_PROC_FS) && defined(CONFIG_VIDEO_PROC_FS) - proc_se401_destroy(); -#endif } module_init(usb_se401_init); diff -Nru a/drivers/usb/media/se401.h b/drivers/usb/media/se401.h --- a/drivers/usb/media/se401.h Tue Sep 2 12:43:27 2003 +++ b/drivers/usb/media/se401.h Tue Sep 2 12:43:27 2003 @@ -224,9 +224,6 @@ wait_queue_head_t wq; /* Processes waiting */ - /* proc interface */ - struct proc_dir_entry *proc_entry; /* /proc/se401/videoX */ - int nullpackets; };