aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/zc0301
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2009-11-27 11:57:15 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-15 21:17:55 -0500
commit38c7c036036c6260606a2a833aaad3794ca22499 (patch)
tree8a41bf5b665a5ba328102e802fc4c7471270b428 /drivers/media/video/zc0301
parenteac8ea536aded07004bde917f05a2329902c64b0 (diff)
V4L/DVB (13550): v4l: Use the new video_device_node_name function
Fix all device drivers to use the new video_device_node_name function. This also strips kernel log messages from the "/dev/" prefix, has the device node location is a userspace policy decision unknown to the kernel. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/zc0301')
-rw-r--r--drivers/media/video/zc0301/zc0301_core.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/drivers/media/video/zc0301/zc0301_core.c b/drivers/media/video/zc0301/zc0301_core.c
index 312a71336fd0..524eb754c97d 100644
--- a/drivers/media/video/zc0301/zc0301_core.c
+++ b/drivers/media/video/zc0301/zc0301_core.c
@@ -538,8 +538,8 @@ static int zc0301_stream_interrupt(struct zc0301_device* cam)
538 else if (cam->stream != STREAM_OFF) { 538 else if (cam->stream != STREAM_OFF) {
539 cam->state |= DEV_MISCONFIGURED; 539 cam->state |= DEV_MISCONFIGURED;
540 DBG(1, "URB timeout reached. The camera is misconfigured. To " 540 DBG(1, "URB timeout reached. The camera is misconfigured. To "
541 "use it, close and open /dev/video%d again.", 541 "use it, close and open %s again.",
542 cam->v4ldev->num); 542 video_device_node_name(cam->v4ldev));
543 return -EIO; 543 return -EIO;
544 } 544 }
545 545
@@ -640,7 +640,8 @@ static void zc0301_release_resources(struct kref *kref)
640{ 640{
641 struct zc0301_device *cam = container_of(kref, struct zc0301_device, 641 struct zc0301_device *cam = container_of(kref, struct zc0301_device,
642 kref); 642 kref);
643 DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->num); 643 DBG(2, "V4L2 device %s deregistered",
644 video_device_node_name(cam->v4ldev));
644 video_set_drvdata(cam->v4ldev, NULL); 645 video_set_drvdata(cam->v4ldev, NULL);
645 video_unregister_device(cam->v4ldev); 646 video_unregister_device(cam->v4ldev);
646 usb_put_dev(cam->usbdev); 647 usb_put_dev(cam->usbdev);
@@ -679,7 +680,8 @@ static int zc0301_open(struct file *filp)
679 } 680 }
680 681
681 if (cam->users) { 682 if (cam->users) {
682 DBG(2, "Device /dev/video%d is busy...", cam->v4ldev->num); 683 DBG(2, "Device %s is busy...",
684 video_device_node_name(cam->v4ldev));
683 DBG(3, "Simultaneous opens are not supported"); 685 DBG(3, "Simultaneous opens are not supported");
684 if ((filp->f_flags & O_NONBLOCK) || 686 if ((filp->f_flags & O_NONBLOCK) ||
685 (filp->f_flags & O_NDELAY)) { 687 (filp->f_flags & O_NDELAY)) {
@@ -722,7 +724,8 @@ static int zc0301_open(struct file *filp)
722 cam->frame_count = 0; 724 cam->frame_count = 0;
723 zc0301_empty_framequeues(cam); 725 zc0301_empty_framequeues(cam);
724 726
725 DBG(3, "Video device /dev/video%d is open", cam->v4ldev->num); 727 DBG(3, "Video device %s is open",
728 video_device_node_name(cam->v4ldev));
726 729
727out: 730out:
728 mutex_unlock(&cam->open_mutex); 731 mutex_unlock(&cam->open_mutex);
@@ -746,7 +749,8 @@ static int zc0301_release(struct file *filp)
746 cam->users--; 749 cam->users--;
747 wake_up_interruptible_nr(&cam->wait_open, 1); 750 wake_up_interruptible_nr(&cam->wait_open, 1);
748 751
749 DBG(3, "Video device /dev/video%d closed", cam->v4ldev->num); 752 DBG(3, "Video device %s closed",
753 video_device_node_name(cam->v4ldev));
750 754
751 kref_put(&cam->kref, zc0301_release_resources); 755 kref_put(&cam->kref, zc0301_release_resources);
752 756
@@ -1276,8 +1280,8 @@ zc0301_vidioc_s_crop(struct zc0301_device* cam, void __user * arg)
1276 if (err) { /* atomic, no rollback in ioctl() */ 1280 if (err) { /* atomic, no rollback in ioctl() */
1277 cam->state |= DEV_MISCONFIGURED; 1281 cam->state |= DEV_MISCONFIGURED;
1278 DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To " 1282 DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To "
1279 "use the camera, close and open /dev/video%d again.", 1283 "use the camera, close and open %s again.",
1280 cam->v4ldev->num); 1284 video_device_node_name(cam->v4ldev));
1281 return -EIO; 1285 return -EIO;
1282 } 1286 }
1283 1287
@@ -1289,8 +1293,8 @@ zc0301_vidioc_s_crop(struct zc0301_device* cam, void __user * arg)
1289 nbuffers != zc0301_request_buffers(cam, nbuffers, cam->io)) { 1293 nbuffers != zc0301_request_buffers(cam, nbuffers, cam->io)) {
1290 cam->state |= DEV_MISCONFIGURED; 1294 cam->state |= DEV_MISCONFIGURED;
1291 DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To " 1295 DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To "
1292 "use the camera, close and open /dev/video%d again.", 1296 "use the camera, close and open %s again.",
1293 cam->v4ldev->num); 1297 video_device_node_name(cam->v4ldev));
1294 return -ENOMEM; 1298 return -ENOMEM;
1295 } 1299 }
1296 1300
@@ -1471,8 +1475,8 @@ zc0301_vidioc_try_s_fmt(struct zc0301_device* cam, unsigned int cmd,
1471 if (err) { /* atomic, no rollback in ioctl() */ 1475 if (err) { /* atomic, no rollback in ioctl() */
1472 cam->state |= DEV_MISCONFIGURED; 1476 cam->state |= DEV_MISCONFIGURED;
1473 DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To " 1477 DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To "
1474 "use the camera, close and open /dev/video%d again.", 1478 "use the camera, close and open %s again.",
1475 cam->v4ldev->num); 1479 video_device_node_name(cam->v4ldev));
1476 return -EIO; 1480 return -EIO;
1477 } 1481 }
1478 1482
@@ -1483,8 +1487,8 @@ zc0301_vidioc_try_s_fmt(struct zc0301_device* cam, unsigned int cmd,
1483 nbuffers != zc0301_request_buffers(cam, nbuffers, cam->io)) { 1487 nbuffers != zc0301_request_buffers(cam, nbuffers, cam->io)) {
1484 cam->state |= DEV_MISCONFIGURED; 1488 cam->state |= DEV_MISCONFIGURED;
1485 DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To " 1489 DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To "
1486 "use the camera, close and open /dev/video%d again.", 1490 "use the camera, close and open %s again.",
1487 cam->v4ldev->num); 1491 video_device_node_name(cam->v4ldev));
1488 return -ENOMEM; 1492 return -ENOMEM;
1489 } 1493 }
1490 1494
@@ -1530,8 +1534,8 @@ zc0301_vidioc_s_jpegcomp(struct zc0301_device* cam, void __user * arg)
1530 if (err) { /* atomic, no rollback in ioctl() */ 1534 if (err) { /* atomic, no rollback in ioctl() */
1531 cam->state |= DEV_MISCONFIGURED; 1535 cam->state |= DEV_MISCONFIGURED;
1532 DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware " 1536 DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware "
1533 "problems. To use the camera, close and open " 1537 "problems. To use the camera, close and open %s again.",
1534 "/dev/video%d again.", cam->v4ldev->num); 1538 video_device_node_name(cam->v4ldev));
1535 return -EIO; 1539 return -EIO;
1536 } 1540 }
1537 1541
@@ -2003,7 +2007,8 @@ zc0301_usb_probe(struct usb_interface* intf, const struct usb_device_id* id)
2003 goto fail; 2007 goto fail;
2004 } 2008 }
2005 2009
2006 DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->num); 2010 DBG(2, "V4L2 device registered as %s",
2011 video_device_node_name(cam->v4ldev));
2007 2012
2008 cam->module_param.force_munmap = force_munmap[dev_nr]; 2013 cam->module_param.force_munmap = force_munmap[dev_nr];
2009 cam->module_param.frame_timeout = frame_timeout[dev_nr]; 2014 cam->module_param.frame_timeout = frame_timeout[dev_nr];
@@ -2040,9 +2045,9 @@ static void zc0301_usb_disconnect(struct usb_interface* intf)
2040 DBG(2, "Disconnecting %s...", cam->v4ldev->name); 2045 DBG(2, "Disconnecting %s...", cam->v4ldev->name);
2041 2046
2042 if (cam->users) { 2047 if (cam->users) {
2043 DBG(2, "Device /dev/video%d is open! Deregistration and " 2048 DBG(2, "Device %s is open! Deregistration and "
2044 "memory deallocation are deferred.", 2049 "memory deallocation are deferred.",
2045 cam->v4ldev->num); 2050 video_device_node_name(cam->v4ldev));
2046 cam->state |= DEV_MISCONFIGURED; 2051 cam->state |= DEV_MISCONFIGURED;
2047 zc0301_stop_transfer(cam); 2052 zc0301_stop_transfer(cam);
2048 cam->state |= DEV_DISCONNECTED; 2053 cam->state |= DEV_DISCONNECTED;