diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2014-12-01 08:10:43 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-12-23 07:29:04 -0500 |
commit | 21a7e0596a63abdf12a9591c29359f7f15e18c16 (patch) | |
tree | a66dfa80fd4c25263afdbbe778548af045cb68b8 | |
parent | e476f4e15d859d1112872667983918bdfa4e663b (diff) |
[media] media: drivers shouldn't touch debug field in video_device
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>
-rw-r--r-- | drivers/media/pci/bt8xx/bttv-driver.c | 1 | ||||
-rw-r--r-- | drivers/media/pci/cx88/cx88-blackbird.c | 3 | ||||
-rw-r--r-- | drivers/media/platform/marvell-ccic/mcam-core.c | 1 | ||||
-rw-r--r-- | drivers/media/usb/cx231xx/cx231xx-video.c | 1 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-video.c | 1 | ||||
-rw-r--r-- | drivers/media/usb/stk1160/stk1160-v4l.c | 5 | ||||
-rw-r--r-- | drivers/media/usb/stkwebcam/stk-webcam.c | 1 | ||||
-rw-r--r-- | drivers/media/usb/tm6000/tm6000-video.c | 3 | ||||
-rw-r--r-- | drivers/media/usb/zr364xx/zr364xx.c | 2 | ||||
-rw-r--r-- | drivers/staging/media/tlg2300/pd-common.h | 1 | ||||
-rw-r--r-- | drivers/staging/media/tlg2300/pd-radio.c | 3 | ||||
-rw-r--r-- | drivers/staging/media/tlg2300/pd-video.c | 10 |
12 files changed, 1 insertions, 31 deletions
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index 665e46dafe68..6eed8f75c13c 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c | |||
@@ -3884,7 +3884,6 @@ static struct video_device *vdev_init(struct bttv *btv, | |||
3884 | *vfd = *template; | 3884 | *vfd = *template; |
3885 | vfd->v4l2_dev = &btv->c.v4l2_dev; | 3885 | vfd->v4l2_dev = &btv->c.v4l2_dev; |
3886 | vfd->release = video_device_release; | 3886 | vfd->release = video_device_release; |
3887 | vfd->debug = bttv_debug; | ||
3888 | video_set_drvdata(vfd, btv); | 3887 | video_set_drvdata(vfd, btv); |
3889 | snprintf(vfd->name, sizeof(vfd->name), "BT%d%s %s (%s)", | 3888 | snprintf(vfd->name, sizeof(vfd->name), "BT%d%s %s (%s)", |
3890 | btv->id, (btv->id==848 && btv->revision==0x12) ? "A" : "", | 3889 | btv->id, (btv->id==848 && btv->revision==0x12) ? "A" : "", |
diff --git a/drivers/media/pci/cx88/cx88-blackbird.c b/drivers/media/pci/cx88/cx88-blackbird.c index d3c79d964f2c..b6be46e94289 100644 --- a/drivers/media/pci/cx88/cx88-blackbird.c +++ b/drivers/media/pci/cx88/cx88-blackbird.c | |||
@@ -1234,6 +1234,3 @@ static void __exit blackbird_fini(void) | |||
1234 | 1234 | ||
1235 | module_init(blackbird_init); | 1235 | module_init(blackbird_init); |
1236 | module_exit(blackbird_fini); | 1236 | module_exit(blackbird_fini); |
1237 | |||
1238 | module_param_named(video_debug,cx8802_mpeg_template.debug, int, 0644); | ||
1239 | MODULE_PARM_DESC(debug,"enable debug messages [video]"); | ||
diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c b/drivers/media/platform/marvell-ccic/mcam-core.c index 193373ff268d..dd5b1415f974 100644 --- a/drivers/media/platform/marvell-ccic/mcam-core.c +++ b/drivers/media/platform/marvell-ccic/mcam-core.c | |||
@@ -1913,7 +1913,6 @@ int mccic_register(struct mcam_camera *cam) | |||
1913 | 1913 | ||
1914 | mutex_lock(&cam->s_mutex); | 1914 | mutex_lock(&cam->s_mutex); |
1915 | cam->vdev = mcam_v4l_template; | 1915 | cam->vdev = mcam_v4l_template; |
1916 | cam->vdev.debug = 0; | ||
1917 | cam->vdev.v4l2_dev = &cam->v4l2_dev; | 1916 | cam->vdev.v4l2_dev = &cam->v4l2_dev; |
1918 | video_set_drvdata(&cam->vdev, cam); | 1917 | video_set_drvdata(&cam->vdev, cam); |
1919 | ret = video_register_device(&cam->vdev, VFL_TYPE_GRABBER, -1); | 1918 | ret = video_register_device(&cam->vdev, VFL_TYPE_GRABBER, -1); |
diff --git a/drivers/media/usb/cx231xx/cx231xx-video.c b/drivers/media/usb/cx231xx/cx231xx-video.c index 53ca12c1ff69..ecea76fe07f6 100644 --- a/drivers/media/usb/cx231xx/cx231xx-video.c +++ b/drivers/media/usb/cx231xx/cx231xx-video.c | |||
@@ -2062,7 +2062,6 @@ static struct video_device *cx231xx_vdev_init(struct cx231xx *dev, | |||
2062 | *vfd = *template; | 2062 | *vfd = *template; |
2063 | vfd->v4l2_dev = &dev->v4l2_dev; | 2063 | vfd->v4l2_dev = &dev->v4l2_dev; |
2064 | vfd->release = video_device_release; | 2064 | vfd->release = video_device_release; |
2065 | vfd->debug = video_debug; | ||
2066 | vfd->lock = &dev->lock; | 2065 | vfd->lock = &dev->lock; |
2067 | 2066 | ||
2068 | snprintf(vfd->name, sizeof(vfd->name), "%s %s", dev->name, type_name); | 2067 | snprintf(vfd->name, sizeof(vfd->name), "%s %s", dev->name, type_name); |
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index cf7f58b76292..3691b39424be 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c | |||
@@ -2192,7 +2192,6 @@ static struct video_device | |||
2192 | 2192 | ||
2193 | *vfd = *template; | 2193 | *vfd = *template; |
2194 | vfd->v4l2_dev = &dev->v4l2->v4l2_dev; | 2194 | vfd->v4l2_dev = &dev->v4l2->v4l2_dev; |
2195 | vfd->debug = video_debug; | ||
2196 | vfd->lock = &dev->lock; | 2195 | vfd->lock = &dev->lock; |
2197 | if (dev->board.is_webcam) | 2196 | if (dev->board.is_webcam) |
2198 | vfd->tvnorms = 0; | 2197 | vfd->tvnorms = 0; |
diff --git a/drivers/media/usb/stk1160/stk1160-v4l.c b/drivers/media/usb/stk1160/stk1160-v4l.c index a47629108c1b..65a326c5128f 100644 --- a/drivers/media/usb/stk1160/stk1160-v4l.c +++ b/drivers/media/usb/stk1160/stk1160-v4l.c | |||
@@ -38,10 +38,6 @@ | |||
38 | #include "stk1160.h" | 38 | #include "stk1160.h" |
39 | #include "stk1160-reg.h" | 39 | #include "stk1160-reg.h" |
40 | 40 | ||
41 | static unsigned int vidioc_debug; | ||
42 | module_param(vidioc_debug, int, 0644); | ||
43 | MODULE_PARM_DESC(vidioc_debug, "enable debug messages [vidioc]"); | ||
44 | |||
45 | static bool keep_buffers; | 41 | static bool keep_buffers; |
46 | module_param(keep_buffers, bool, 0644); | 42 | module_param(keep_buffers, bool, 0644); |
47 | MODULE_PARM_DESC(keep_buffers, "don't release buffers upon stop streaming"); | 43 | MODULE_PARM_DESC(keep_buffers, "don't release buffers upon stop streaming"); |
@@ -659,7 +655,6 @@ int stk1160_video_register(struct stk1160 *dev) | |||
659 | 655 | ||
660 | /* Initialize video_device with a template structure */ | 656 | /* Initialize video_device with a template structure */ |
661 | dev->vdev = v4l_template; | 657 | dev->vdev = v4l_template; |
662 | dev->vdev.debug = vidioc_debug; | ||
663 | dev->vdev.queue = &dev->vb_vidq; | 658 | dev->vdev.queue = &dev->vb_vidq; |
664 | 659 | ||
665 | /* | 660 | /* |
diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c index 3588dc38db87..e08fa587332f 100644 --- a/drivers/media/usb/stkwebcam/stk-webcam.c +++ b/drivers/media/usb/stkwebcam/stk-webcam.c | |||
@@ -1262,7 +1262,6 @@ static int stk_register_video_device(struct stk_camera *dev) | |||
1262 | 1262 | ||
1263 | dev->vdev = stk_v4l_data; | 1263 | dev->vdev = stk_v4l_data; |
1264 | dev->vdev.lock = &dev->lock; | 1264 | dev->vdev.lock = &dev->lock; |
1265 | dev->vdev.debug = debug; | ||
1266 | dev->vdev.v4l2_dev = &dev->v4l2_dev; | 1265 | dev->vdev.v4l2_dev = &dev->v4l2_dev; |
1267 | video_set_drvdata(&dev->vdev, dev); | 1266 | video_set_drvdata(&dev->vdev, dev); |
1268 | err = video_register_device(&dev->vdev, VFL_TYPE_GRABBER, -1); | 1267 | err = video_register_device(&dev->vdev, VFL_TYPE_GRABBER, -1); |
diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c index 793577fc4633..0f14d3ccc7b4 100644 --- a/drivers/media/usb/tm6000/tm6000-video.c +++ b/drivers/media/usb/tm6000/tm6000-video.c | |||
@@ -941,7 +941,7 @@ static int vidioc_try_fmt_vid_cap(struct file *file, void *priv, | |||
941 | 941 | ||
942 | fmt = format_by_fourcc(f->fmt.pix.pixelformat); | 942 | fmt = format_by_fourcc(f->fmt.pix.pixelformat); |
943 | if (NULL == fmt) { | 943 | if (NULL == fmt) { |
944 | dprintk(dev, V4L2_DEBUG_IOCTL_ARG, "Fourcc format (0x%08x)" | 944 | dprintk(dev, 2, "Fourcc format (0x%08x)" |
945 | " invalid.\n", f->fmt.pix.pixelformat); | 945 | " invalid.\n", f->fmt.pix.pixelformat); |
946 | return -EINVAL; | 946 | return -EINVAL; |
947 | } | 947 | } |
@@ -1622,7 +1622,6 @@ static struct video_device *vdev_init(struct tm6000_core *dev, | |||
1622 | *vfd = *template; | 1622 | *vfd = *template; |
1623 | vfd->v4l2_dev = &dev->v4l2_dev; | 1623 | vfd->v4l2_dev = &dev->v4l2_dev; |
1624 | vfd->release = video_device_release; | 1624 | vfd->release = video_device_release; |
1625 | vfd->debug = tm6000_debug; | ||
1626 | vfd->lock = &dev->lock; | 1625 | vfd->lock = &dev->lock; |
1627 | 1626 | ||
1628 | snprintf(vfd->name, sizeof(vfd->name), "%s %s", dev->name, type_name); | 1627 | snprintf(vfd->name, sizeof(vfd->name), "%s %s", dev->name, type_name); |
diff --git a/drivers/media/usb/zr364xx/zr364xx.c b/drivers/media/usb/zr364xx/zr364xx.c index 5c006277b8b1..ca850316d379 100644 --- a/drivers/media/usb/zr364xx/zr364xx.c +++ b/drivers/media/usb/zr364xx/zr364xx.c | |||
@@ -1454,8 +1454,6 @@ static int zr364xx_probe(struct usb_interface *intf, | |||
1454 | cam->vdev.v4l2_dev = &cam->v4l2_dev; | 1454 | cam->vdev.v4l2_dev = &cam->v4l2_dev; |
1455 | cam->vdev.ctrl_handler = &cam->ctrl_handler; | 1455 | cam->vdev.ctrl_handler = &cam->ctrl_handler; |
1456 | video_set_drvdata(&cam->vdev, cam); | 1456 | video_set_drvdata(&cam->vdev, cam); |
1457 | if (debug) | ||
1458 | cam->vdev.debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG; | ||
1459 | 1457 | ||
1460 | cam->udev = udev; | 1458 | cam->udev = udev; |
1461 | 1459 | ||
diff --git a/drivers/staging/media/tlg2300/pd-common.h b/drivers/staging/media/tlg2300/pd-common.h index 9e23ad32d2fe..04c5aacd836e 100644 --- a/drivers/staging/media/tlg2300/pd-common.h +++ b/drivers/staging/media/tlg2300/pd-common.h | |||
@@ -250,7 +250,6 @@ void free_all_urb_generic(struct urb **urb_array, int num); | |||
250 | /* misc */ | 250 | /* misc */ |
251 | void poseidon_delete(struct kref *kref); | 251 | void poseidon_delete(struct kref *kref); |
252 | extern int debug_mode; | 252 | extern int debug_mode; |
253 | void set_debug_mode(struct video_device *vfd, int debug_mode); | ||
254 | 253 | ||
255 | #ifdef CONFIG_PM | 254 | #ifdef CONFIG_PM |
256 | #define in_hibernation(pd) (pd->msg.event == PM_EVENT_FREEZE) | 255 | #define in_hibernation(pd) (pd->msg.event == PM_EVENT_FREEZE) |
diff --git a/drivers/staging/media/tlg2300/pd-radio.c b/drivers/staging/media/tlg2300/pd-radio.c index b391194a840c..c0567b5ed363 100644 --- a/drivers/staging/media/tlg2300/pd-radio.c +++ b/drivers/staging/media/tlg2300/pd-radio.c | |||
@@ -98,12 +98,9 @@ static int poseidon_fm_open(struct file *filp) | |||
98 | 98 | ||
99 | usb_autopm_get_interface(p->interface); | 99 | usb_autopm_get_interface(p->interface); |
100 | if (0 == p->state) { | 100 | if (0 == p->state) { |
101 | struct video_device *vfd = &p->radio_data.fm_dev; | ||
102 | |||
103 | /* default pre-emphasis */ | 101 | /* default pre-emphasis */ |
104 | if (p->radio_data.pre_emphasis == 0) | 102 | if (p->radio_data.pre_emphasis == 0) |
105 | p->radio_data.pre_emphasis = TLG_TUNE_ASTD_FM_EUR; | 103 | p->radio_data.pre_emphasis = TLG_TUNE_ASTD_FM_EUR; |
106 | set_debug_mode(vfd, debug_mode); | ||
107 | 104 | ||
108 | ret = poseidon_check_mode_radio(p); | 105 | ret = poseidon_check_mode_radio(p); |
109 | if (ret < 0) { | 106 | if (ret < 0) { |
diff --git a/drivers/staging/media/tlg2300/pd-video.c b/drivers/staging/media/tlg2300/pd-video.c index 8cd7f02fcf9f..c0c3c1c4517c 100644 --- a/drivers/staging/media/tlg2300/pd-video.c +++ b/drivers/staging/media/tlg2300/pd-video.c | |||
@@ -1299,15 +1299,6 @@ static int pm_video_resume(struct poseidon *pd) | |||
1299 | } | 1299 | } |
1300 | #endif | 1300 | #endif |
1301 | 1301 | ||
1302 | void set_debug_mode(struct video_device *vfd, int debug_mode) | ||
1303 | { | ||
1304 | vfd->debug = 0; | ||
1305 | if (debug_mode & 0x1) | ||
1306 | vfd->debug = V4L2_DEBUG_IOCTL; | ||
1307 | if (debug_mode & 0x2) | ||
1308 | vfd->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG; | ||
1309 | } | ||
1310 | |||
1311 | static void init_video_context(struct running_context *context) | 1302 | static void init_video_context(struct running_context *context) |
1312 | { | 1303 | { |
1313 | context->sig_index = 0; | 1304 | context->sig_index = 0; |
@@ -1354,7 +1345,6 @@ static int pd_video_open(struct file *file) | |||
1354 | 1345 | ||
1355 | front->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; | 1346 | front->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; |
1356 | pd->video_data.users++; | 1347 | pd->video_data.users++; |
1357 | set_debug_mode(vfd, debug_mode); | ||
1358 | 1348 | ||
1359 | videobuf_queue_vmalloc_init(&front->q, &pd_video_qops, | 1349 | videobuf_queue_vmalloc_init(&front->q, &pd_video_qops, |
1360 | NULL, &front->queue_lock, | 1350 | NULL, &front->queue_lock, |