diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2009-11-27 11:57:15 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-15 21:17:55 -0500 |
commit | 38c7c036036c6260606a2a833aaad3794ca22499 (patch) | |
tree | 8a41bf5b665a5ba328102e802fc4c7471270b428 /drivers/media/video/sn9c102 | |
parent | eac8ea536aded07004bde917f05a2329902c64b0 (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/sn9c102')
-rw-r--r-- | drivers/media/video/sn9c102/sn9c102_core.c | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c index 4a7711c3e745..4cf41a8d44ed 100644 --- a/drivers/media/video/sn9c102/sn9c102_core.c +++ b/drivers/media/video/sn9c102/sn9c102_core.c | |||
@@ -1007,8 +1007,8 @@ static int sn9c102_stream_interrupt(struct sn9c102_device* cam) | |||
1007 | else if (cam->stream != STREAM_OFF) { | 1007 | else if (cam->stream != STREAM_OFF) { |
1008 | cam->state |= DEV_MISCONFIGURED; | 1008 | cam->state |= DEV_MISCONFIGURED; |
1009 | DBG(1, "URB timeout reached. The camera is misconfigured. " | 1009 | DBG(1, "URB timeout reached. The camera is misconfigured. " |
1010 | "To use it, close and open /dev/video%d again.", | 1010 | "To use it, close and open %s again.", |
1011 | cam->v4ldev->num); | 1011 | video_device_node_name(cam->v4ldev)); |
1012 | return -EIO; | 1012 | return -EIO; |
1013 | } | 1013 | } |
1014 | 1014 | ||
@@ -1734,7 +1734,8 @@ static void sn9c102_release_resources(struct kref *kref) | |||
1734 | 1734 | ||
1735 | cam = container_of(kref, struct sn9c102_device, kref); | 1735 | cam = container_of(kref, struct sn9c102_device, kref); |
1736 | 1736 | ||
1737 | DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->num); | 1737 | DBG(2, "V4L2 device %s deregistered", |
1738 | video_device_node_name(cam->v4ldev)); | ||
1738 | video_set_drvdata(cam->v4ldev, NULL); | 1739 | video_set_drvdata(cam->v4ldev, NULL); |
1739 | video_unregister_device(cam->v4ldev); | 1740 | video_unregister_device(cam->v4ldev); |
1740 | usb_put_dev(cam->usbdev); | 1741 | usb_put_dev(cam->usbdev); |
@@ -1791,8 +1792,8 @@ static int sn9c102_open(struct file *filp) | |||
1791 | } | 1792 | } |
1792 | 1793 | ||
1793 | if (cam->users) { | 1794 | if (cam->users) { |
1794 | DBG(2, "Device /dev/video%d is already in use", | 1795 | DBG(2, "Device %s is already in use", |
1795 | cam->v4ldev->num); | 1796 | video_device_node_name(cam->v4ldev)); |
1796 | DBG(3, "Simultaneous opens are not supported"); | 1797 | DBG(3, "Simultaneous opens are not supported"); |
1797 | /* | 1798 | /* |
1798 | open() must follow the open flags and should block | 1799 | open() must follow the open flags and should block |
@@ -1845,7 +1846,7 @@ static int sn9c102_open(struct file *filp) | |||
1845 | cam->frame_count = 0; | 1846 | cam->frame_count = 0; |
1846 | sn9c102_empty_framequeues(cam); | 1847 | sn9c102_empty_framequeues(cam); |
1847 | 1848 | ||
1848 | DBG(3, "Video device /dev/video%d is open", cam->v4ldev->num); | 1849 | DBG(3, "Video device %s is open", video_device_node_name(cam->v4ldev)); |
1849 | 1850 | ||
1850 | out: | 1851 | out: |
1851 | mutex_unlock(&cam->open_mutex); | 1852 | mutex_unlock(&cam->open_mutex); |
@@ -1870,7 +1871,7 @@ static int sn9c102_release(struct file *filp) | |||
1870 | cam->users--; | 1871 | cam->users--; |
1871 | wake_up_interruptible_nr(&cam->wait_open, 1); | 1872 | wake_up_interruptible_nr(&cam->wait_open, 1); |
1872 | 1873 | ||
1873 | DBG(3, "Video device /dev/video%d closed", cam->v4ldev->num); | 1874 | DBG(3, "Video device %s closed", video_device_node_name(cam->v4ldev)); |
1874 | 1875 | ||
1875 | kref_put(&cam->kref, sn9c102_release_resources); | 1876 | kref_put(&cam->kref, sn9c102_release_resources); |
1876 | 1877 | ||
@@ -2433,8 +2434,8 @@ sn9c102_vidioc_s_crop(struct sn9c102_device* cam, void __user * arg) | |||
2433 | if (err) { /* atomic, no rollback in ioctl() */ | 2434 | if (err) { /* atomic, no rollback in ioctl() */ |
2434 | cam->state |= DEV_MISCONFIGURED; | 2435 | cam->state |= DEV_MISCONFIGURED; |
2435 | DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To " | 2436 | DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To " |
2436 | "use the camera, close and open /dev/video%d again.", | 2437 | "use the camera, close and open %s again.", |
2437 | cam->v4ldev->num); | 2438 | video_device_node_name(cam->v4ldev)); |
2438 | return -EIO; | 2439 | return -EIO; |
2439 | } | 2440 | } |
2440 | 2441 | ||
@@ -2446,8 +2447,8 @@ sn9c102_vidioc_s_crop(struct sn9c102_device* cam, void __user * arg) | |||
2446 | nbuffers != sn9c102_request_buffers(cam, nbuffers, cam->io)) { | 2447 | nbuffers != sn9c102_request_buffers(cam, nbuffers, cam->io)) { |
2447 | cam->state |= DEV_MISCONFIGURED; | 2448 | cam->state |= DEV_MISCONFIGURED; |
2448 | DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To " | 2449 | DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To " |
2449 | "use the camera, close and open /dev/video%d again.", | 2450 | "use the camera, close and open %s again.", |
2450 | cam->v4ldev->num); | 2451 | video_device_node_name(cam->v4ldev)); |
2451 | return -ENOMEM; | 2452 | return -ENOMEM; |
2452 | } | 2453 | } |
2453 | 2454 | ||
@@ -2690,8 +2691,8 @@ sn9c102_vidioc_try_s_fmt(struct sn9c102_device* cam, unsigned int cmd, | |||
2690 | if (err) { /* atomic, no rollback in ioctl() */ | 2691 | if (err) { /* atomic, no rollback in ioctl() */ |
2691 | cam->state |= DEV_MISCONFIGURED; | 2692 | cam->state |= DEV_MISCONFIGURED; |
2692 | DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To " | 2693 | DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To " |
2693 | "use the camera, close and open /dev/video%d again.", | 2694 | "use the camera, close and open %s again.", |
2694 | cam->v4ldev->num); | 2695 | video_device_node_name(cam->v4ldev)); |
2695 | return -EIO; | 2696 | return -EIO; |
2696 | } | 2697 | } |
2697 | 2698 | ||
@@ -2702,8 +2703,8 @@ sn9c102_vidioc_try_s_fmt(struct sn9c102_device* cam, unsigned int cmd, | |||
2702 | nbuffers != sn9c102_request_buffers(cam, nbuffers, cam->io)) { | 2703 | nbuffers != sn9c102_request_buffers(cam, nbuffers, cam->io)) { |
2703 | cam->state |= DEV_MISCONFIGURED; | 2704 | cam->state |= DEV_MISCONFIGURED; |
2704 | DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To " | 2705 | DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To " |
2705 | "use the camera, close and open /dev/video%d again.", | 2706 | "use the camera, close and open %s again.", |
2706 | cam->v4ldev->num); | 2707 | video_device_node_name(cam->v4ldev)); |
2707 | return -ENOMEM; | 2708 | return -ENOMEM; |
2708 | } | 2709 | } |
2709 | 2710 | ||
@@ -2748,9 +2749,9 @@ sn9c102_vidioc_s_jpegcomp(struct sn9c102_device* cam, void __user * arg) | |||
2748 | err += sn9c102_set_compression(cam, &jc); | 2749 | err += sn9c102_set_compression(cam, &jc); |
2749 | if (err) { /* atomic, no rollback in ioctl() */ | 2750 | if (err) { /* atomic, no rollback in ioctl() */ |
2750 | cam->state |= DEV_MISCONFIGURED; | 2751 | cam->state |= DEV_MISCONFIGURED; |
2751 | DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware " | 2752 | DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware problems. " |
2752 | "problems. To use the camera, close and open " | 2753 | "To use the camera, close and open %s again.", |
2753 | "/dev/video%d again.", cam->v4ldev->num); | 2754 | video_device_node_name(cam->v4ldev)); |
2754 | return -EIO; | 2755 | return -EIO; |
2755 | } | 2756 | } |
2756 | 2757 | ||
@@ -3346,7 +3347,8 @@ sn9c102_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) | |||
3346 | goto fail; | 3347 | goto fail; |
3347 | } | 3348 | } |
3348 | 3349 | ||
3349 | DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->num); | 3350 | DBG(2, "V4L2 device registered as %s", |
3351 | video_device_node_name(cam->v4ldev)); | ||
3350 | 3352 | ||
3351 | video_set_drvdata(cam->v4ldev, cam); | 3353 | video_set_drvdata(cam->v4ldev, cam); |
3352 | cam->module_param.force_munmap = force_munmap[dev_nr]; | 3354 | cam->module_param.force_munmap = force_munmap[dev_nr]; |
@@ -3398,9 +3400,9 @@ static void sn9c102_usb_disconnect(struct usb_interface* intf) | |||
3398 | DBG(2, "Disconnecting %s...", cam->v4ldev->name); | 3400 | DBG(2, "Disconnecting %s...", cam->v4ldev->name); |
3399 | 3401 | ||
3400 | if (cam->users) { | 3402 | if (cam->users) { |
3401 | DBG(2, "Device /dev/video%d is open! Deregistration and " | 3403 | DBG(2, "Device %s is open! Deregistration and memory " |
3402 | "memory deallocation are deferred.", | 3404 | "deallocation are deferred.", |
3403 | cam->v4ldev->num); | 3405 | video_device_node_name(cam->v4ldev)); |
3404 | cam->state |= DEV_MISCONFIGURED; | 3406 | cam->state |= DEV_MISCONFIGURED; |
3405 | sn9c102_stop_transfer(cam); | 3407 | sn9c102_stop_transfer(cam); |
3406 | cam->state |= DEV_DISCONNECTED; | 3408 | cam->state |= DEV_DISCONNECTED; |