aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-10-04 07:36:54 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 07:37:16 -0400
commitdd89601d47e2eeab7c17b25f2549444751bcffe4 (patch)
treeda21e8b17e49d175f5b8cbd14a772bf00f7fb63a /drivers/media/video/em28xx
parente86a93dc3c870c412592c1f298c1425d80c58c6e (diff)
V4L/DVB (9133): v4l: disconnect kernel number from minor
The v4l core creates four different video devices (video, vbi, radio, vtx) and each has its own range of minor numbers. However, modern devices keep increasing the number of devices that they need so a maximum of 64 video devices will not be enough in the future. In addition this scheme makes it very hard to add new device types. This patch disconnects the kernel number allocation (e.g. video0, video1, etc.) from the actual minor number (just pick the first free minor). This allows for much more flexibility in the future. However, it does require the use of udev. For those who cannot use udev a new CONFIG option was created that changes the allocation scheme back to the old behavior. Thanks to Greg KH for suggesting this approach during the 2008 LPC. In addition, several bugs were fixed in the ivtv and cx18 drivers: these drivers try to allocate specific kernel numbers but that scheme contained a bug which caused what should have been e.g. video17 to appear as e.g. video2. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx')
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index 50d2c7a9b3c1..c53649e5315b 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -1600,8 +1600,7 @@ static void em28xx_release_resources(struct em28xx *dev)
1600 /*FIXME: I2C IR should be disconnected */ 1600 /*FIXME: I2C IR should be disconnected */
1601 1601
1602 em28xx_info("V4L2 devices /dev/video%d and /dev/vbi%d deregistered\n", 1602 em28xx_info("V4L2 devices /dev/video%d and /dev/vbi%d deregistered\n",
1603 dev->vdev->minor-MINOR_VFL_TYPE_GRABBER_MIN, 1603 dev->vdev->num, dev->vbi_dev->num);
1604 dev->vbi_dev->minor-MINOR_VFL_TYPE_VBI_MIN);
1605 list_del(&dev->devlist); 1604 list_del(&dev->devlist);
1606 if (dev->sbutton_input_dev) 1605 if (dev->sbutton_input_dev)
1607 em28xx_deregister_snapshot_button(dev); 1606 em28xx_deregister_snapshot_button(dev);
@@ -2073,8 +2072,7 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev,
2073 video_mux(dev, 0); 2072 video_mux(dev, 0);
2074 2073
2075 em28xx_info("V4L2 device registered as /dev/video%d and /dev/vbi%d\n", 2074 em28xx_info("V4L2 device registered as /dev/video%d and /dev/vbi%d\n",
2076 dev->vdev->minor-MINOR_VFL_TYPE_GRABBER_MIN, 2075 dev->vdev->num, dev->vbi_dev->num);
2077 dev->vbi_dev->minor-MINOR_VFL_TYPE_VBI_MIN);
2078 2076
2079 mutex_lock(&em28xx_extension_devlist_lock); 2077 mutex_lock(&em28xx_extension_devlist_lock);
2080 if (!list_empty(&em28xx_extension_devlist)) { 2078 if (!list_empty(&em28xx_extension_devlist)) {
@@ -2274,7 +2272,7 @@ static void em28xx_usb_disconnect(struct usb_interface *interface)
2274 em28xx_warn 2272 em28xx_warn
2275 ("device /dev/video%d is open! Deregistration and memory " 2273 ("device /dev/video%d is open! Deregistration and memory "
2276 "deallocation are deferred on close.\n", 2274 "deallocation are deferred on close.\n",
2277 dev->vdev->minor-MINOR_VFL_TYPE_GRABBER_MIN); 2275 dev->vdev->num);
2278 2276
2279 dev->state |= DEV_MISCONFIGURED; 2277 dev->state |= DEV_MISCONFIGURED;
2280 em28xx_uninit_isoc(dev); 2278 em28xx_uninit_isoc(dev);