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/et61x251 | |
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/et61x251')
-rw-r--r-- | drivers/media/video/et61x251/et61x251_core.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/media/video/et61x251/et61x251_core.c b/drivers/media/video/et61x251/et61x251_core.c index 7a85c41b0eea..9d0ef96c23ff 100644 --- a/drivers/media/video/et61x251/et61x251_core.c +++ b/drivers/media/video/et61x251/et61x251_core.c | |||
@@ -588,7 +588,7 @@ static int et61x251_stream_interrupt(struct et61x251_device* cam) | |||
588 | cam->state |= DEV_MISCONFIGURED; | 588 | cam->state |= DEV_MISCONFIGURED; |
589 | DBG(1, "URB timeout reached. The camera is misconfigured. To " | 589 | DBG(1, "URB timeout reached. The camera is misconfigured. To " |
590 | "use it, close and open /dev/video%d again.", | 590 | "use it, close and open /dev/video%d again.", |
591 | cam->v4ldev->minor); | 591 | cam->v4ldev->num); |
592 | return -EIO; | 592 | return -EIO; |
593 | } | 593 | } |
594 | 594 | ||
@@ -1195,7 +1195,7 @@ static void et61x251_release_resources(struct kref *kref) | |||
1195 | 1195 | ||
1196 | cam = container_of(kref, struct et61x251_device, kref); | 1196 | cam = container_of(kref, struct et61x251_device, kref); |
1197 | 1197 | ||
1198 | DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->minor); | 1198 | DBG(2, "V4L2 device /dev/video%d deregistered", cam->v4ldev->num); |
1199 | video_set_drvdata(cam->v4ldev, NULL); | 1199 | video_set_drvdata(cam->v4ldev, NULL); |
1200 | video_unregister_device(cam->v4ldev); | 1200 | video_unregister_device(cam->v4ldev); |
1201 | usb_put_dev(cam->usbdev); | 1201 | usb_put_dev(cam->usbdev); |
@@ -1237,7 +1237,7 @@ static int et61x251_open(struct inode* inode, struct file* filp) | |||
1237 | 1237 | ||
1238 | if (cam->users) { | 1238 | if (cam->users) { |
1239 | DBG(2, "Device /dev/video%d is already in use", | 1239 | DBG(2, "Device /dev/video%d is already in use", |
1240 | cam->v4ldev->minor); | 1240 | cam->v4ldev->num); |
1241 | DBG(3, "Simultaneous opens are not supported"); | 1241 | DBG(3, "Simultaneous opens are not supported"); |
1242 | if ((filp->f_flags & O_NONBLOCK) || | 1242 | if ((filp->f_flags & O_NONBLOCK) || |
1243 | (filp->f_flags & O_NDELAY)) { | 1243 | (filp->f_flags & O_NDELAY)) { |
@@ -1280,7 +1280,7 @@ static int et61x251_open(struct inode* inode, struct file* filp) | |||
1280 | cam->frame_count = 0; | 1280 | cam->frame_count = 0; |
1281 | et61x251_empty_framequeues(cam); | 1281 | et61x251_empty_framequeues(cam); |
1282 | 1282 | ||
1283 | DBG(3, "Video device /dev/video%d is open", cam->v4ldev->minor); | 1283 | DBG(3, "Video device /dev/video%d is open", cam->v4ldev->num); |
1284 | 1284 | ||
1285 | out: | 1285 | out: |
1286 | mutex_unlock(&cam->open_mutex); | 1286 | mutex_unlock(&cam->open_mutex); |
@@ -1304,7 +1304,7 @@ static int et61x251_release(struct inode* inode, struct file* filp) | |||
1304 | cam->users--; | 1304 | cam->users--; |
1305 | wake_up_interruptible_nr(&cam->wait_open, 1); | 1305 | wake_up_interruptible_nr(&cam->wait_open, 1); |
1306 | 1306 | ||
1307 | DBG(3, "Video device /dev/video%d closed", cam->v4ldev->minor); | 1307 | DBG(3, "Video device /dev/video%d closed", cam->v4ldev->num); |
1308 | 1308 | ||
1309 | kref_put(&cam->kref, et61x251_release_resources); | 1309 | kref_put(&cam->kref, et61x251_release_resources); |
1310 | 1310 | ||
@@ -1845,7 +1845,7 @@ et61x251_vidioc_s_crop(struct et61x251_device* cam, void __user * arg) | |||
1845 | cam->state |= DEV_MISCONFIGURED; | 1845 | cam->state |= DEV_MISCONFIGURED; |
1846 | DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To " | 1846 | DBG(1, "VIDIOC_S_CROP failed because of hardware problems. To " |
1847 | "use the camera, close and open /dev/video%d again.", | 1847 | "use the camera, close and open /dev/video%d again.", |
1848 | cam->v4ldev->minor); | 1848 | cam->v4ldev->num); |
1849 | return -EIO; | 1849 | return -EIO; |
1850 | } | 1850 | } |
1851 | 1851 | ||
@@ -1858,7 +1858,7 @@ et61x251_vidioc_s_crop(struct et61x251_device* cam, void __user * arg) | |||
1858 | cam->state |= DEV_MISCONFIGURED; | 1858 | cam->state |= DEV_MISCONFIGURED; |
1859 | DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To " | 1859 | DBG(1, "VIDIOC_S_CROP failed because of not enough memory. To " |
1860 | "use the camera, close and open /dev/video%d again.", | 1860 | "use the camera, close and open /dev/video%d again.", |
1861 | cam->v4ldev->minor); | 1861 | cam->v4ldev->num); |
1862 | return -ENOMEM; | 1862 | return -ENOMEM; |
1863 | } | 1863 | } |
1864 | 1864 | ||
@@ -2068,7 +2068,7 @@ et61x251_vidioc_try_s_fmt(struct et61x251_device* cam, unsigned int cmd, | |||
2068 | cam->state |= DEV_MISCONFIGURED; | 2068 | cam->state |= DEV_MISCONFIGURED; |
2069 | DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To " | 2069 | DBG(1, "VIDIOC_S_FMT failed because of hardware problems. To " |
2070 | "use the camera, close and open /dev/video%d again.", | 2070 | "use the camera, close and open /dev/video%d again.", |
2071 | cam->v4ldev->minor); | 2071 | cam->v4ldev->num); |
2072 | return -EIO; | 2072 | return -EIO; |
2073 | } | 2073 | } |
2074 | 2074 | ||
@@ -2080,7 +2080,7 @@ et61x251_vidioc_try_s_fmt(struct et61x251_device* cam, unsigned int cmd, | |||
2080 | cam->state |= DEV_MISCONFIGURED; | 2080 | cam->state |= DEV_MISCONFIGURED; |
2081 | DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To " | 2081 | DBG(1, "VIDIOC_S_FMT failed because of not enough memory. To " |
2082 | "use the camera, close and open /dev/video%d again.", | 2082 | "use the camera, close and open /dev/video%d again.", |
2083 | cam->v4ldev->minor); | 2083 | cam->v4ldev->num); |
2084 | return -ENOMEM; | 2084 | return -ENOMEM; |
2085 | } | 2085 | } |
2086 | 2086 | ||
@@ -2128,7 +2128,7 @@ et61x251_vidioc_s_jpegcomp(struct et61x251_device* cam, void __user * arg) | |||
2128 | cam->state |= DEV_MISCONFIGURED; | 2128 | cam->state |= DEV_MISCONFIGURED; |
2129 | DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware " | 2129 | DBG(1, "VIDIOC_S_JPEGCOMP failed because of hardware " |
2130 | "problems. To use the camera, close and open " | 2130 | "problems. To use the camera, close and open " |
2131 | "/dev/video%d again.", cam->v4ldev->minor); | 2131 | "/dev/video%d again.", cam->v4ldev->num); |
2132 | return -EIO; | 2132 | return -EIO; |
2133 | } | 2133 | } |
2134 | 2134 | ||
@@ -2605,7 +2605,7 @@ et61x251_usb_probe(struct usb_interface* intf, const struct usb_device_id* id) | |||
2605 | goto fail; | 2605 | goto fail; |
2606 | } | 2606 | } |
2607 | 2607 | ||
2608 | DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->minor); | 2608 | DBG(2, "V4L2 device registered as /dev/video%d", cam->v4ldev->num); |
2609 | 2609 | ||
2610 | cam->module_param.force_munmap = force_munmap[dev_nr]; | 2610 | cam->module_param.force_munmap = force_munmap[dev_nr]; |
2611 | cam->module_param.frame_timeout = frame_timeout[dev_nr]; | 2611 | cam->module_param.frame_timeout = frame_timeout[dev_nr]; |
@@ -2658,7 +2658,7 @@ static void et61x251_usb_disconnect(struct usb_interface* intf) | |||
2658 | if (cam->users) { | 2658 | if (cam->users) { |
2659 | DBG(2, "Device /dev/video%d is open! Deregistration and " | 2659 | DBG(2, "Device /dev/video%d is open! Deregistration and " |
2660 | "memory deallocation are deferred.", | 2660 | "memory deallocation are deferred.", |
2661 | cam->v4ldev->minor); | 2661 | cam->v4ldev->num); |
2662 | cam->state |= DEV_MISCONFIGURED; | 2662 | cam->state |= DEV_MISCONFIGURED; |
2663 | et61x251_stop_transfer(cam); | 2663 | et61x251_stop_transfer(cam); |
2664 | cam->state |= DEV_DISCONNECTED; | 2664 | cam->state |= DEV_DISCONNECTED; |