[media] media: drivers shouldn't touch debug field in video_device
authorHans Verkuil <hans.verkuil@cisco.com>
Mon, 1 Dec 2014 13:10:43 +0000 (10:10 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 23 Dec 2014 12:29:04 +0000 (10:29 -0200)
The debug field in struct video_device is for internal use only and
drivers should mix that with their own debug module options.

It is handled by the V4L2 core and users can set it using
/sys/class/video4linux/<devX>/debug.

It has been deprecated for some time now, so it is time to remove it
completely from the drivers.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
12 files changed:
drivers/media/pci/bt8xx/bttv-driver.c
drivers/media/pci/cx88/cx88-blackbird.c
drivers/media/platform/marvell-ccic/mcam-core.c
drivers/media/usb/cx231xx/cx231xx-video.c
drivers/media/usb/em28xx/em28xx-video.c
drivers/media/usb/stk1160/stk1160-v4l.c
drivers/media/usb/stkwebcam/stk-webcam.c
drivers/media/usb/tm6000/tm6000-video.c
drivers/media/usb/zr364xx/zr364xx.c
drivers/staging/media/tlg2300/pd-common.h
drivers/staging/media/tlg2300/pd-radio.c
drivers/staging/media/tlg2300/pd-video.c

index 665e46dafe68aeca336cd1d26a2393ffc008dd67..6eed8f75c13c77b6c2b3bffb7f924c0f13fb90ff 100644 (file)
@@ -3884,7 +3884,6 @@ static struct video_device *vdev_init(struct bttv *btv,
        *vfd = *template;
        vfd->v4l2_dev = &btv->c.v4l2_dev;
        vfd->release = video_device_release;
-       vfd->debug   = bttv_debug;
        video_set_drvdata(vfd, btv);
        snprintf(vfd->name, sizeof(vfd->name), "BT%d%s %s (%s)",
                 btv->id, (btv->id==848 && btv->revision==0x12) ? "A" : "",
index d3c79d964f2cda152691302eb462939aed59e870..b6be46e942895d43a179eafa00728b36ff876cf5 100644 (file)
@@ -1234,6 +1234,3 @@ static void __exit blackbird_fini(void)
 
 module_init(blackbird_init);
 module_exit(blackbird_fini);
-
-module_param_named(video_debug,cx8802_mpeg_template.debug, int, 0644);
-MODULE_PARM_DESC(debug,"enable debug messages [video]");
index 193373ff268dad773d14d07ce0a7c9414c94f451..dd5b1415f97444103835c677fc1cde879876fe8c 100644 (file)
@@ -1913,7 +1913,6 @@ int mccic_register(struct mcam_camera *cam)
 
        mutex_lock(&cam->s_mutex);
        cam->vdev = mcam_v4l_template;
-       cam->vdev.debug = 0;
        cam->vdev.v4l2_dev = &cam->v4l2_dev;
        video_set_drvdata(&cam->vdev, cam);
        ret = video_register_device(&cam->vdev, VFL_TYPE_GRABBER, -1);
index 53ca12c1ff699b3f26ba4fb03df03c5cd7a6a8bb..ecea76fe07f6121c8a44fbdc7b34d9456d0a400f 100644 (file)
@@ -2062,7 +2062,6 @@ static struct video_device *cx231xx_vdev_init(struct cx231xx *dev,
        *vfd = *template;
        vfd->v4l2_dev = &dev->v4l2_dev;
        vfd->release = video_device_release;
-       vfd->debug = video_debug;
        vfd->lock = &dev->lock;
 
        snprintf(vfd->name, sizeof(vfd->name), "%s %s", dev->name, type_name);
index cf7f58b7629293c6d5899607bd004d4b900e9e7c..3691b39424bede7663886f614397c76ccdda2e86 100644 (file)
@@ -2192,7 +2192,6 @@ static struct video_device
 
        *vfd            = *template;
        vfd->v4l2_dev   = &dev->v4l2->v4l2_dev;
-       vfd->debug      = video_debug;
        vfd->lock       = &dev->lock;
        if (dev->board.is_webcam)
                vfd->tvnorms = 0;
index a47629108c1b8b85e9c23110769b8d337928fc72..65a326c5128fda082e1b9ac0e8ca176f86b44a62 100644 (file)
 #include "stk1160.h"
 #include "stk1160-reg.h"
 
-static unsigned int vidioc_debug;
-module_param(vidioc_debug, int, 0644);
-MODULE_PARM_DESC(vidioc_debug, "enable debug messages [vidioc]");
-
 static bool keep_buffers;
 module_param(keep_buffers, bool, 0644);
 MODULE_PARM_DESC(keep_buffers, "don't release buffers upon stop streaming");
@@ -659,7 +655,6 @@ int stk1160_video_register(struct stk1160 *dev)
 
        /* Initialize video_device with a template structure */
        dev->vdev = v4l_template;
-       dev->vdev.debug = vidioc_debug;
        dev->vdev.queue = &dev->vb_vidq;
 
        /*
index 3588dc38db874077ad24c62fb7f04daf9df44793..e08fa587332f88028d2f762d8191c589e6403b1b 100644 (file)
@@ -1262,7 +1262,6 @@ static int stk_register_video_device(struct stk_camera *dev)
 
        dev->vdev = stk_v4l_data;
        dev->vdev.lock = &dev->lock;
-       dev->vdev.debug = debug;
        dev->vdev.v4l2_dev = &dev->v4l2_dev;
        video_set_drvdata(&dev->vdev, dev);
        err = video_register_device(&dev->vdev, VFL_TYPE_GRABBER, -1);
index 793577fc46336ea417a4aeb49337690ff32220b2..0f14d3ccc7b4454a7b16bf810e9467410eaa7a49 100644 (file)
@@ -941,7 +941,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
 
        fmt = format_by_fourcc(f->fmt.pix.pixelformat);
        if (NULL == fmt) {
-               dprintk(dev, V4L2_DEBUG_IOCTL_ARG, "Fourcc format (0x%08x)"
+               dprintk(dev, 2, "Fourcc format (0x%08x)"
                                " invalid.\n", f->fmt.pix.pixelformat);
                return -EINVAL;
        }
@@ -1622,7 +1622,6 @@ static struct video_device *vdev_init(struct tm6000_core *dev,
        *vfd = *template;
        vfd->v4l2_dev = &dev->v4l2_dev;
        vfd->release = video_device_release;
-       vfd->debug = tm6000_debug;
        vfd->lock = &dev->lock;
 
        snprintf(vfd->name, sizeof(vfd->name), "%s %s", dev->name, type_name);
index 5c006277b8b15ab405bc8f8e9c35695975d25c64..ca850316d379062271352f7abb54d3bd4cb7c84c 100644 (file)
@@ -1454,8 +1454,6 @@ static int zr364xx_probe(struct usb_interface *intf,
        cam->vdev.v4l2_dev = &cam->v4l2_dev;
        cam->vdev.ctrl_handler = &cam->ctrl_handler;
        video_set_drvdata(&cam->vdev, cam);
-       if (debug)
-               cam->vdev.debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
 
        cam->udev = udev;
 
index 9e23ad32d2fe338ae749f90bb0416f3d49932b0a..04c5aacd836ebc515dbcce6ec5501c2094de1b1b 100644 (file)
@@ -250,7 +250,6 @@ void free_all_urb_generic(struct urb **urb_array, int num);
 /* misc */
 void poseidon_delete(struct kref *kref);
 extern int debug_mode;
-void set_debug_mode(struct video_device *vfd, int debug_mode);
 
 #ifdef CONFIG_PM
 #define in_hibernation(pd) (pd->msg.event == PM_EVENT_FREEZE)
index b391194a840c4258a2c7ce8cbc9974ad6970bd01..c0567b5ed3634b5f7bfcc22fe233f23b66c09027 100644 (file)
@@ -98,12 +98,9 @@ static int poseidon_fm_open(struct file *filp)
 
        usb_autopm_get_interface(p->interface);
        if (0 == p->state) {
-               struct video_device *vfd = &p->radio_data.fm_dev;
-
                /* default pre-emphasis */
                if (p->radio_data.pre_emphasis == 0)
                        p->radio_data.pre_emphasis = TLG_TUNE_ASTD_FM_EUR;
-               set_debug_mode(vfd, debug_mode);
 
                ret = poseidon_check_mode_radio(p);
                if (ret < 0) {
index 8cd7f02fcf9fc7080ea6444bfb56c50854c6c80e..c0c3c1c4517c8bba3fc562e22e72dffdf972465c 100644 (file)
@@ -1299,15 +1299,6 @@ static int pm_video_resume(struct poseidon *pd)
 }
 #endif
 
-void set_debug_mode(struct video_device *vfd, int debug_mode)
-{
-       vfd->debug = 0;
-       if (debug_mode & 0x1)
-               vfd->debug = V4L2_DEBUG_IOCTL;
-       if (debug_mode & 0x2)
-               vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
-}
-
 static void init_video_context(struct running_context *context)
 {
        context->sig_index      = 0;
@@ -1354,7 +1345,6 @@ static int pd_video_open(struct file *file)
 
                front->type             = V4L2_BUF_TYPE_VIDEO_CAPTURE;
                pd->video_data.users++;
-               set_debug_mode(vfd, debug_mode);
 
                videobuf_queue_vmalloc_init(&front->q, &pd_video_qops,
                                NULL, &front->queue_lock,