diff options
author | Sigmund Augdal Helberg <sigmund@snap.tv> | 2005-12-01 03:51:19 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-12-01 18:48:56 -0500 |
commit | 938606b02b3d7b587777e5b1e44f4196903250ca (patch) | |
tree | 136b2a3b770e04959a2979e5bb47ee3dd819ec7c /drivers/media/video | |
parent | db1d1d57e97700b4131fe80556dc6ef976d534c4 (diff) |
[PATCH] V4L: Fixes maximum number of VBI devices
- Increases the minor number limitation for vbi devices from 223 to 255.
This is in agreement with the minor number allocation specified in
Documentation/devices.txt.
- Without this patch it is not possible to use more than 5 Hauppauge
WinTV-PVR 350 cards since each of these allocate 3 vbi devices.
Signed-of-by: Sigmund Augdal Helberg <sigmund@snap.tv>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/videodev.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c index 83c49f9610d0..6de5b0094b82 100644 --- a/drivers/media/video/videodev.c +++ b/drivers/media/video/videodev.c | |||
@@ -76,14 +76,14 @@ static void video_release(struct class_device *cd) | |||
76 | } | 76 | } |
77 | 77 | ||
78 | static struct class video_class = { | 78 | static struct class video_class = { |
79 | .name = VIDEO_NAME, | 79 | .name = VIDEO_NAME, |
80 | .release = video_release, | 80 | .release = video_release, |
81 | }; | 81 | }; |
82 | 82 | ||
83 | /* | 83 | /* |
84 | * Active devices | 84 | * Active devices |
85 | */ | 85 | */ |
86 | 86 | ||
87 | static struct video_device *video_device[VIDEO_NUM_DEVICES]; | 87 | static struct video_device *video_device[VIDEO_NUM_DEVICES]; |
88 | static DECLARE_MUTEX(videodev_lock); | 88 | static DECLARE_MUTEX(videodev_lock); |
89 | 89 | ||
@@ -101,7 +101,7 @@ static int video_open(struct inode *inode, struct file *file) | |||
101 | int err = 0; | 101 | int err = 0; |
102 | struct video_device *vfl; | 102 | struct video_device *vfl; |
103 | struct file_operations *old_fops; | 103 | struct file_operations *old_fops; |
104 | 104 | ||
105 | if(minor>=VIDEO_NUM_DEVICES) | 105 | if(minor>=VIDEO_NUM_DEVICES) |
106 | return -ENODEV; | 106 | return -ENODEV; |
107 | down(&videodev_lock); | 107 | down(&videodev_lock); |
@@ -189,7 +189,7 @@ video_usercopy(struct inode *inode, struct file *file, | |||
189 | return -ENOMEM; | 189 | return -ENOMEM; |
190 | parg = mbuf; | 190 | parg = mbuf; |
191 | } | 191 | } |
192 | 192 | ||
193 | err = -EFAULT; | 193 | err = -EFAULT; |
194 | if (_IOC_DIR(cmd) & _IOC_WRITE) | 194 | if (_IOC_DIR(cmd) & _IOC_WRITE) |
195 | if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd))) | 195 | if (copy_from_user(parg, (void __user *)arg, _IOC_SIZE(cmd))) |
@@ -240,7 +240,7 @@ int video_exclusive_open(struct inode *inode, struct file *file) | |||
240 | int video_exclusive_release(struct inode *inode, struct file *file) | 240 | int video_exclusive_release(struct inode *inode, struct file *file) |
241 | { | 241 | { |
242 | struct video_device *vfl = video_devdata(file); | 242 | struct video_device *vfl = video_devdata(file); |
243 | 243 | ||
244 | vfl->users--; | 244 | vfl->users--; |
245 | return 0; | 245 | return 0; |
246 | } | 246 | } |
@@ -253,7 +253,7 @@ static struct file_operations video_fops; | |||
253 | * @type: type of device to register | 253 | * @type: type of device to register |
254 | * @nr: which device number (0 == /dev/video0, 1 == /dev/video1, ... | 254 | * @nr: which device number (0 == /dev/video0, 1 == /dev/video1, ... |
255 | * -1 == first free) | 255 | * -1 == first free) |
256 | * | 256 | * |
257 | * The registration code assigns minor numbers based on the type | 257 | * The registration code assigns minor numbers based on the type |
258 | * requested. -ENFILE is returned in all the device slots for this | 258 | * requested. -ENFILE is returned in all the device slots for this |
259 | * category are full. If not then the minor field is set and the | 259 | * category are full. If not then the minor field is set and the |
@@ -269,7 +269,7 @@ static struct file_operations video_fops; | |||
269 | * | 269 | * |
270 | * %VFL_TYPE_VBI - Vertical blank data (undecoded) | 270 | * %VFL_TYPE_VBI - Vertical blank data (undecoded) |
271 | * | 271 | * |
272 | * %VFL_TYPE_RADIO - A radio card | 272 | * %VFL_TYPE_RADIO - A radio card |
273 | */ | 273 | */ |
274 | 274 | ||
275 | int video_register_device(struct video_device *vfd, int type, int nr) | 275 | int video_register_device(struct video_device *vfd, int type, int nr) |
@@ -278,7 +278,7 @@ int video_register_device(struct video_device *vfd, int type, int nr) | |||
278 | int base; | 278 | int base; |
279 | int end; | 279 | int end; |
280 | char *name_base; | 280 | char *name_base; |
281 | 281 | ||
282 | switch(type) | 282 | switch(type) |
283 | { | 283 | { |
284 | case VFL_TYPE_GRABBER: | 284 | case VFL_TYPE_GRABBER: |
@@ -293,7 +293,7 @@ int video_register_device(struct video_device *vfd, int type, int nr) | |||
293 | break; | 293 | break; |
294 | case VFL_TYPE_VBI: | 294 | case VFL_TYPE_VBI: |
295 | base=224; | 295 | base=224; |
296 | end=240; | 296 | end=256; |
297 | name_base = "vbi"; | 297 | name_base = "vbi"; |
298 | break; | 298 | break; |
299 | case VFL_TYPE_RADIO: | 299 | case VFL_TYPE_RADIO: |
@@ -334,7 +334,7 @@ int video_register_device(struct video_device *vfd, int type, int nr) | |||
334 | init_MUTEX(&vfd->lock); | 334 | init_MUTEX(&vfd->lock); |
335 | 335 | ||
336 | /* sysfs class */ | 336 | /* sysfs class */ |
337 | memset(&vfd->class_dev, 0x00, sizeof(vfd->class_dev)); | 337 | memset(&vfd->class_dev, 0x00, sizeof(vfd->class_dev)); |
338 | if (vfd->dev) | 338 | if (vfd->dev) |
339 | vfd->class_dev.dev = vfd->dev; | 339 | vfd->class_dev.dev = vfd->dev; |
340 | vfd->class_dev.class = &video_class; | 340 | vfd->class_dev.class = &video_class; |
@@ -360,7 +360,7 @@ int video_register_device(struct video_device *vfd, int type, int nr) | |||
360 | * This unregisters the passed device and deassigns the minor | 360 | * This unregisters the passed device and deassigns the minor |
361 | * number. Future open calls will be met with errors. | 361 | * number. Future open calls will be met with errors. |
362 | */ | 362 | */ |
363 | 363 | ||
364 | void video_unregister_device(struct video_device *vfd) | 364 | void video_unregister_device(struct video_device *vfd) |
365 | { | 365 | { |
366 | down(&videodev_lock); | 366 | down(&videodev_lock); |
@@ -384,7 +384,7 @@ static struct file_operations video_fops= | |||
384 | /* | 384 | /* |
385 | * Initialise video for linux | 385 | * Initialise video for linux |
386 | */ | 386 | */ |
387 | 387 | ||
388 | static int __init videodev_init(void) | 388 | static int __init videodev_init(void) |
389 | { | 389 | { |
390 | int ret; | 390 | int ret; |