diff options
-rw-r--r-- | linux/drivers/media/video/vivi.c | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/linux/drivers/media/video/vivi.c b/linux/drivers/media/video/vivi.c index 7b976ec11..ec11f19bb 100644 --- a/linux/drivers/media/video/vivi.c +++ b/linux/drivers/media/video/vivi.c @@ -51,24 +51,15 @@ #include "font.h" -MODULE_DESCRIPTION("Video Technology Magazine Virtual Video Capture Board"); -MODULE_AUTHOR("Mauro Carvalho Chehab, Ted Walther and John Sokol"); -MODULE_LICENSE("Dual BSD/GPL"); - #define VIVI_MAJOR_VERSION 0 #define VIVI_MINOR_VERSION 4 #define VIVI_RELEASE 0 #define VIVI_VERSION KERNEL_VERSION(VIVI_MAJOR_VERSION, VIVI_MINOR_VERSION, VIVI_RELEASE) -static int video_nr = -1; /* /dev/videoN, -1 for autodetect */ -module_param(video_nr, int, 0); - -static int debug = 0; -module_param(debug, int, 0); - -static unsigned int vid_limit = 16; -module_param(vid_limit,int,0644); -MODULE_PARM_DESC(vid_limit,"capture memory limit in megabytes"); +/* Declare static vars that will be used as parameters */ +static unsigned int vid_limit = 16; /* Video memory limit, in Mb */ +static struct video_device vivi; /* Video device */ +static int video_nr = -1; /* /dev/videoN, -1 for autodetect */ /* supported controls */ static struct v4l2_queryctrl vivi_qctrl[] = { @@ -122,10 +113,10 @@ static struct v4l2_queryctrl vivi_qctrl[] = { static int qctl_regs[ARRAY_SIZE(vivi_qctrl)]; -#define dprintk(level,fmt, arg...) \ - do { \ - if (debug >= (level)) \ - printk(KERN_DEBUG "vivi: " fmt , ## arg); \ +#define dprintk(level,fmt, arg...) \ + do { \ + if (vivi.debug >= (level)) \ + printk(KERN_DEBUG "vivi: " fmt , ## arg); \ } while (0) /* ------------------------------------------------------------------ @@ -960,7 +951,7 @@ static int vidioc_enum_fmt_cap (struct file *file, void *priv, struct v4l2_fmtdesc *f) { if (f->index > 0) - return (EINVAL); + return -EINVAL; strlcpy(f->description,format.name,sizeof(f->description)); f->pixelformat = format.fourcc; @@ -1167,7 +1158,7 @@ static int vidioc_g_input (struct file *file, void *priv, unsigned int *i) static int vidioc_s_input (struct file *file, void *priv, unsigned int i) { if (i > 0) - return (-EINVAL); + return -EINVAL; return (0); } @@ -1185,7 +1176,7 @@ static int vidioc_queryctrl (struct file *file, void *priv, return (0); } - return (-EINVAL); + return -EINVAL; } static int vidioc_g_ctrl (struct file *file, void *priv, @@ -1199,7 +1190,7 @@ static int vidioc_g_ctrl (struct file *file, void *priv, return (0); } - return (-EINVAL); + return -EINVAL; } static int vidioc_s_ctrl (struct file *file, void *priv, struct v4l2_control *ctrl) @@ -1217,7 +1208,7 @@ static int vidioc_s_ctrl (struct file *file, void *priv, qctl_regs[i]=ctrl->value; return (0); } - return (-EINVAL); + return -EINVAL; } /* ------------------------------------------------------------------ @@ -1398,7 +1389,7 @@ static struct file_operations vivi_fops = { }; static struct video_device vivi = { - .name = "VTM Virtual Video Capture Board", + .name = "vivi", .type = VID_TYPE_CAPTURE, .hardware = 0, .fops = &vivi_fops, @@ -1471,3 +1462,16 @@ static void __exit vivi_exit(void) module_init(vivi_init); module_exit(vivi_exit); + +MODULE_DESCRIPTION("Video Technology Magazine Virtual Video Capture Board"); +MODULE_AUTHOR("Mauro Carvalho Chehab, Ted Walther and John Sokol"); +MODULE_LICENSE("Dual BSD/GPL"); + +module_param(video_nr, int, 0); + +module_param_named(debug,vivi.debug, int, 0644); +MODULE_PARM_DESC(debug,"activates debug info"); + +module_param(vid_limit,int,0644); +MODULE_PARM_DESC(vid_limit,"capture memory limit in megabytes"); + |