diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-10-19 17:54:26 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-21 12:31:37 -0400 |
commit | c6330fb86fd0fed98b7e0d5792881a77b778fefc (patch) | |
tree | 3c87d6fa7053963cfdea592a2956b28354ce0832 /drivers/media/video/zc0301 | |
parent | 323a491a29d0bb1e91263ca347cb42c4de28adfc (diff) |
V4L/DVB (9327): v4l: use video_device.num instead of minor in video%d
The kernel number of a v4l2 node (e.g. videoX, radioX or vbiX) is now
independent of the minor number. So instead of using the minor field
of the video_device struct one has to use the num field: this always
contains the kernel number of the device node.
I forgot about this when I did the v4l2 core change, so this patch
converts all drivers that use it in one go. Luckily the change is
trivial.
Cc: michael@mihu.de
Cc: mchehab@infradead.org
Cc: corbet@lwn.net
Cc: luca.risolia@studio.unibo.it
Cc: isely@pobox.com
Cc: pe1rxq@amsat.org
Cc: royale@zerezo.com
Cc: mkrufky@linuxtv.org
Cc: stoth@linuxtv.org
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
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.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/media/video/zc0301/zc0301_core.c b/drivers/media/video/zc0301/zc0301_core.c index 6a0902bcba6b..9fc581707638 100644 --- a/drivers/media/video/zc0301/zc0301_core.c +++ b/drivers/media/video/zc0301/zc0301_core.c | |||
@@ -539,7 +539,7 @@ static int zc0301_stream_interrupt(struct zc0301_device* cam) | |||
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 /dev/video%d again.", |
542 | cam->v4ldev->minor); | 542 | cam->v4ldev->num); |
543 | return -EIO; | 543 | return -EIO; |
544 | } | 544 | } |
545 | 545 | ||
@@ -640,7 +640,7 @@ 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->minor); | 643 | DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->num); |
644 | video_set_drvdata(cam->v4ldev, NULL); | 644 | video_set_drvdata(cam->v4ldev, NULL); |
645 | video_unregister_device(cam->v4ldev); | 645 | video_unregister_device(cam->v4ldev); |
646 | usb_put_dev(cam->usbdev); | 646 | usb_put_dev(cam->usbdev); |
@@ -679,7 +679,7 @@ static int zc0301_open(struct inode* inode, struct file* filp) | |||
679 | } | 679 | } |
680 | 680 | ||
681 | if (cam->users) { | 681 | if (cam->users) { |
682 | DBG(2, "Device /dev/video%d is busy...", cam->v4ldev->minor); | 682 | DBG(2, "Device /dev/video%d is busy...", cam->v4ldev->num); |
683 | DBG(3, "Simultaneous opens are not supported"); | 683 | DBG(3, "Simultaneous opens are not supported"); |
684 | if ((filp->f_flags & O_NONBLOCK) || | 684 | if ((filp->f_flags & O_NONBLOCK) || |
685 | (filp->f_flags & O_NDELAY)) { | 685 | (filp->f_flags & O_NDELAY)) { |
@@ -722,7 +722,7 @@ static int zc0301_open(struct inode* inode, struct file* filp) | |||
722 | cam->frame_count = 0; | 722 | cam->frame_count = 0; |
723 | zc0301_empty_framequeues(cam); | 723 | zc0301_empty_framequeues(cam); |
724 | 724 | ||
725 | DBG(3, "Video device /dev/video%d is open", cam->v4ldev->minor); | 725 | DBG(3, "Video device /dev/video%d is open", cam->v4ldev->num); |
726 | 726 | ||
727 | out: | 727 | out: |
728 | mutex_unlock(&cam->open_mutex); | 728 | mutex_unlock(&cam->open_mutex); |
@@ -746,7 +746,7 @@ static int zc0301_release(struct inode* inode, struct file* filp) | |||
746 | cam->users--; | 746 | cam->users--; |
747 | wake_up_interruptible_nr(&cam->wait_open, 1); | 747 | wake_up_interruptible_nr(&cam->wait_open, 1); |
748 | 748 | ||
749 | DBG(3, "Video device /dev/video%d closed", cam->v4ldev->minor); | 749 | DBG(3, "Video device /dev/video%d closed", cam->v4ldev->num); |
750 | 750 | ||
751 | kref_put(&cam->kref, zc0301_release_resources); | 751 | kref_put(&cam->kref, zc0301_release_resources); |
752 | 752 | ||
@@ -1275,7 +1275,7 @@ zc0301_vidioc_s_crop(struct zc0301_device* cam, void __user * arg) | |||
1275 | cam->state |= DEV_MISCONFIGURED; | 1275 | cam->state |= DEV_MISCONFIGURED; |
1276 | DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To " | 1276 | DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To " |
1277 | "use the camera, close and open /dev/video%d again.", | 1277 | "use the camera, close and open /dev/video%d again.", |
1278 | cam->v4ldev->minor); | 1278 | cam->v4ldev->num); |
1279 | return -EIO; | 1279 | return -EIO; |
1280 | } | 1280 | } |
1281 | 1281 | ||
@@ -1288,7 +1288,7 @@ zc0301_vidioc_s_crop(struct zc0301_device* cam, void __user * arg) | |||
1288 | cam->state |= DEV_MISCONFIGURED; | 1288 | cam->state |= DEV_MISCONFIGURED; |
1289 | DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To " | 1289 | DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To " |
1290 | "use the camera, close and open /dev/video%d again.", | 1290 | "use the camera, close and open /dev/video%d again.", |
1291 | cam->v4ldev->minor); | 1291 | cam->v4ldev->num); |
1292 | return -ENOMEM; | 1292 | return -ENOMEM; |
1293 | } | 1293 | } |
1294 | 1294 | ||
@@ -1470,7 +1470,7 @@ zc0301_vidioc_try_s_fmt(struct zc0301_device* cam, unsigned int cmd, | |||
1470 | cam->state |= DEV_MISCONFIGURED; | 1470 | cam->state |= DEV_MISCONFIGURED; |
1471 | DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To " | 1471 | DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To " |
1472 | "use the camera, close and open /dev/video%d again.", | 1472 | "use the camera, close and open /dev/video%d again.", |
1473 | cam->v4ldev->minor); | 1473 | cam->v4ldev->num); |
1474 | return -EIO; | 1474 | return -EIO; |
1475 | } | 1475 | } |
1476 | 1476 | ||
@@ -1482,7 +1482,7 @@ zc0301_vidioc_try_s_fmt(struct zc0301_device* cam, unsigned int cmd, | |||
1482 | cam->state |= DEV_MISCONFIGURED; | 1482 | cam->state |= DEV_MISCONFIGURED; |
1483 | DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To " | 1483 | DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To " |
1484 | "use the camera, close and open /dev/video%d again.", | 1484 | "use the camera, close and open /dev/video%d again.", |
1485 | cam->v4ldev->minor); | 1485 | cam->v4ldev->num); |
1486 | return -ENOMEM; | 1486 | return -ENOMEM; |
1487 | } | 1487 | } |
1488 | 1488 | ||
@@ -1529,7 +1529,7 @@ zc0301_vidioc_s_jpegcomp(struct zc0301_device* cam, void __user * arg) | |||
1529 | cam->state |= DEV_MISCONFIGURED; | 1529 | cam->state |= DEV_MISCONFIGURED; |
1530 | DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware " | 1530 | DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware " |
1531 | "problems. To use the camera, close and open " | 1531 | "problems. To use the camera, close and open " |
1532 | "/dev/video%d again.", cam->v4ldev->minor); | 1532 | "/dev/video%d again.", cam->v4ldev->num); |
1533 | return -EIO; | 1533 | return -EIO; |
1534 | } | 1534 | } |
1535 | 1535 | ||
@@ -2005,7 +2005,7 @@ zc0301_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) | |||
2005 | goto fail; | 2005 | goto fail; |
2006 | } | 2006 | } |
2007 | 2007 | ||
2008 | DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->minor); | 2008 | DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->num); |
2009 | 2009 | ||
2010 | cam->module_param.force_munmap = force_munmap[dev_nr]; | 2010 | cam->module_param.force_munmap = force_munmap[dev_nr]; |
2011 | cam->module_param.frame_timeout = frame_timeout[dev_nr]; | 2011 | cam->module_param.frame_timeout = frame_timeout[dev_nr]; |
@@ -2044,7 +2044,7 @@ static void zc0301_usb_disconnect(struct usb_interface* intf) | |||
2044 | if (cam->users) { | 2044 | if (cam->users) { |
2045 | DBG(2, "Device /dev/video%d is open! Deregistration and " | 2045 | DBG(2, "Device /dev/video%d is open! Deregistration and " |
2046 | "memory deallocation are deferred.", | 2046 | "memory deallocation are deferred.", |
2047 | cam->v4ldev->minor); | 2047 | cam->v4ldev->num); |
2048 | cam->state |= DEV_MISCONFIGURED; | 2048 | cam->state |= DEV_MISCONFIGURED; |
2049 | zc0301_stop_transfer(cam); | 2049 | zc0301_stop_transfer(cam); |
2050 | cam->state |= DEV_DISCONNECTED; | 2050 | cam->state |= DEV_DISCONNECTED; |