]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/cpia.c
V4L/DVB (5180): Fix cx2584x revision reporting.
[linux-2.6-omap-h63xx.git] / drivers / media / video / cpia.c
index 2227c5640c12c9552ade8b05d92cc9d8a7ad3234..78c9699eafbbe46e791cc7c228c413b47182394c 100644 (file)
@@ -26,7 +26,6 @@
 /* define _CPIA_DEBUG_ for verbose debug output (see cpia.h) */
 /* #define _CPIA_DEBUG_  1 */
 
-#include <linux/config.h>
 
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 
 #include "cpia.h"
 
-#ifdef CONFIG_VIDEO_CPIA_PP
-extern int cpia_pp_init(void);
-#endif
-#ifdef CONFIG_VIDEO_CPIA_USB
-extern int cpia_usb_init(void);
-#endif
-
 static int video_nr = -1;
 
 #ifdef MODULE
@@ -64,14 +56,13 @@ MODULE_LICENSE("GPL");
 MODULE_SUPPORTED_DEVICE("video");
 #endif
 
-static unsigned short colorspace_conv = 0;
+static unsigned short colorspace_conv;
 module_param(colorspace_conv, ushort, 0444);
 MODULE_PARM_DESC(colorspace_conv,
-                "\n<n> Colorspace conversion:"
-                "\n0 = disable"
-                "\n1 = enable"
-                "\nDefault value is 0"
-                "\n");
+                " Colorspace conversion:"
+                "\n  0 = disable, 1 = enable"
+                "\n  Default value is 0"
+                );
 
 #define ABOUT "V4L-Driver for Vision CPiA based cameras"
 
@@ -1359,13 +1350,13 @@ out:
 
 static void create_proc_cpia_cam(struct cam_data *cam)
 {
-       char name[7];
+       char name[5 + 1 + 10 + 1];
        struct proc_dir_entry *ent;
 
        if (!cpia_proc_root || !cam)
                return;
 
-       sprintf(name, "video%d", cam->vdev.minor);
+       snprintf(name, sizeof(name), "video%d", cam->vdev.minor);
 
        ent = create_proc_entry(name, S_IFREG|S_IRUGO|S_IWUSR, cpia_proc_root);
        if (!ent)
@@ -1385,12 +1376,12 @@ static void create_proc_cpia_cam(struct cam_data *cam)
 
 static void destroy_proc_cpia_cam(struct cam_data *cam)
 {
-       char name[7];
+       char name[5 + 1 + 10 + 1];
 
        if (!cam || !cam->proc_entry)
                return;
 
-       sprintf(name, "video%d", cam->vdev.minor);
+       snprintf(name, sizeof(name), "video%d", cam->vdev.minor);
        remove_proc_entry(name, cpia_proc_root);
        cam->proc_entry = NULL;
 }
@@ -3162,8 +3153,7 @@ static int reset_camera(struct cam_data *cam)
 
 static void put_cam(struct cpia_camera_ops* ops)
 {
-       if (ops->owner)
-               module_put(ops->owner);
+       module_put(ops->owner);
 }
 
 /* ------------------------- V4L interface --------------------- */
@@ -3800,7 +3790,7 @@ static int cpia_mmap(struct file *file, struct vm_area_struct *vma)
        return 0;
 }
 
-static struct file_operations cpia_fops = {
+static const struct file_operations cpia_fops = {
        .owner          = THIS_MODULE,
        .open           = cpia_open,
        .release        = cpia_close,
@@ -4042,19 +4032,12 @@ static int __init cpia_init(void)
               "allowed, it is disabled by default now. Users should fix the "
               "applications in case they don't work without conversion "
               "reenabled by setting the 'colorspace_conv' module "
-              "parameter to 1");
+              "parameter to 1\n");
 
 #ifdef CONFIG_PROC_FS
        proc_cpia_create();
 #endif
 
-#ifdef CONFIG_VIDEO_CPIA_PP
-       cpia_pp_init();
-#endif
-#ifdef CONFIG_VIDEO_CPIA_USB
-       cpia_usb_init();
-#endif
-
        return 0;
 }