diff options
author | Markus Rechberger <mrechberger@gmail.com> | 2005-11-09 00:37:52 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-09 10:56:22 -0500 |
commit | 9c75541fc97252e605b7bc8f9b09f816483e22fb (patch) | |
tree | 81cd5eb12405322625ff88fa1e1cb705eeb1fe45 /drivers/media/video | |
parent | c2f6f9d866d3ea25eebe32c6c51e47e5141669cf (diff) |
[PATCH] v4l: 813: replaced obsolete video get drvdata and video set drvdata
- Replaced obsolete video_get_drvdata and video_set_drvdata
Signed-off-by: Markus Rechberger <mrechberger@gmail.com>
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/em28xx/em28xx-video.c | 45 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx.h | 1 |
2 files changed, 35 insertions, 11 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index e5066d05697e..daa4387a2296 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -50,6 +50,8 @@ MODULE_AUTHOR(DRIVER_AUTHOR); | |||
50 | MODULE_DESCRIPTION(DRIVER_DESC); | 50 | MODULE_DESCRIPTION(DRIVER_DESC); |
51 | MODULE_LICENSE("GPL"); | 51 | MODULE_LICENSE("GPL"); |
52 | 52 | ||
53 | static LIST_HEAD(em2820_devlist); | ||
54 | |||
53 | static unsigned int card[] = {[0 ... (EM2820_MAXBOARDS - 1)] = UNSET }; | 55 | static unsigned int card[] = {[0 ... (EM2820_MAXBOARDS - 1)] = UNSET }; |
54 | 56 | ||
55 | module_param_array(card, int, NULL, 0444); | 57 | module_param_array(card, int, NULL, 0444); |
@@ -257,10 +259,20 @@ static void em2820_empty_framequeues(struct em2820 *dev) | |||
257 | */ | 259 | */ |
258 | static int em2820_v4l2_open(struct inode *inode, struct file *filp) | 260 | static int em2820_v4l2_open(struct inode *inode, struct file *filp) |
259 | { | 261 | { |
260 | struct video_device *vdev = video_devdata(filp); | ||
261 | int minor = iminor(inode); | 262 | int minor = iminor(inode); |
262 | struct em2820 *dev = (struct em2820 *)video_get_drvdata(vdev); | ||
263 | int errCode = 0; | 263 | int errCode = 0; |
264 | struct em2820 *h,*dev = NULL; | ||
265 | struct list_head *list; | ||
266 | |||
267 | list_for_each(list,&em2820_devlist) { | ||
268 | h = list_entry(list, struct em2820, devlist); | ||
269 | if (h->vdev->minor == minor) { | ||
270 | dev = h; | ||
271 | } | ||
272 | } | ||
273 | |||
274 | filp->private_data=dev; | ||
275 | |||
264 | 276 | ||
265 | em2820_videodbg("users=%d", dev->users); | 277 | em2820_videodbg("users=%d", dev->users); |
266 | 278 | ||
@@ -333,7 +345,7 @@ static void em2820_release_resources(struct em2820 *dev) | |||
333 | 345 | ||
334 | em2820_info("V4L2 device /dev/video%d deregistered\n", | 346 | em2820_info("V4L2 device /dev/video%d deregistered\n", |
335 | dev->vdev->minor); | 347 | dev->vdev->minor); |
336 | video_set_drvdata(dev->vdev, NULL); | 348 | list_del(&dev->devlist); |
337 | video_unregister_device(dev->vdev); | 349 | video_unregister_device(dev->vdev); |
338 | /* video_unregister_device(dev->vbi_dev); */ | 350 | /* video_unregister_device(dev->vbi_dev); */ |
339 | em2820_i2c_unregister(dev); | 351 | em2820_i2c_unregister(dev); |
@@ -347,9 +359,18 @@ static void em2820_release_resources(struct em2820 *dev) | |||
347 | */ | 359 | */ |
348 | static int em2820_v4l2_close(struct inode *inode, struct file *file) | 360 | static int em2820_v4l2_close(struct inode *inode, struct file *file) |
349 | { | 361 | { |
350 | struct video_device *vdev = video_devdata(file); | ||
351 | struct em2820 *dev = (struct em2820 *)video_get_drvdata(vdev); | ||
352 | int errCode; | 362 | int errCode; |
363 | int minor = iminor(inode); | ||
364 | struct em2820 *h,*dev = NULL; | ||
365 | struct list_head *list; | ||
366 | |||
367 | list_for_each(list,&em2820_devlist) { | ||
368 | h = list_entry(list, struct em2820, devlist); | ||
369 | if (h->vdev->minor == minor) { | ||
370 | dev = h; | ||
371 | } | ||
372 | } | ||
373 | |||
353 | 374 | ||
354 | em2820_videodbg("users=%d", dev->users); | 375 | em2820_videodbg("users=%d", dev->users); |
355 | 376 | ||
@@ -390,10 +411,10 @@ static ssize_t | |||
390 | em2820_v4l2_read(struct file *filp, char __user * buf, size_t count, | 411 | em2820_v4l2_read(struct file *filp, char __user * buf, size_t count, |
391 | loff_t * f_pos) | 412 | loff_t * f_pos) |
392 | { | 413 | { |
393 | struct em2820 *dev = video_get_drvdata(video_devdata(filp)); | ||
394 | struct em2820_frame_t *f, *i; | 414 | struct em2820_frame_t *f, *i; |
395 | unsigned long lock_flags; | 415 | unsigned long lock_flags; |
396 | int ret = 0; | 416 | int ret = 0; |
417 | struct em2820 *dev = filp->private_data; | ||
397 | 418 | ||
398 | if (down_interruptible(&dev->fileop_lock)) | 419 | if (down_interruptible(&dev->fileop_lock)) |
399 | return -ERESTARTSYS; | 420 | return -ERESTARTSYS; |
@@ -482,8 +503,8 @@ em2820_v4l2_read(struct file *filp, char __user * buf, size_t count, | |||
482 | */ | 503 | */ |
483 | static unsigned int em2820_v4l2_poll(struct file *filp, poll_table * wait) | 504 | static unsigned int em2820_v4l2_poll(struct file *filp, poll_table * wait) |
484 | { | 505 | { |
485 | struct em2820 *dev = video_get_drvdata(video_devdata(filp)); | ||
486 | unsigned int mask = 0; | 506 | unsigned int mask = 0; |
507 | struct em2820 *dev = filp->private_data; | ||
487 | 508 | ||
488 | if (down_interruptible(&dev->fileop_lock)) | 509 | if (down_interruptible(&dev->fileop_lock)) |
489 | return POLLERR; | 510 | return POLLERR; |
@@ -550,10 +571,12 @@ static struct vm_operations_struct em2820_vm_ops = { | |||
550 | */ | 571 | */ |
551 | static int em2820_v4l2_mmap(struct file *filp, struct vm_area_struct *vma) | 572 | static int em2820_v4l2_mmap(struct file *filp, struct vm_area_struct *vma) |
552 | { | 573 | { |
553 | struct em2820 *dev = video_get_drvdata(video_devdata(filp)); | ||
554 | unsigned long size = vma->vm_end - vma->vm_start, | 574 | unsigned long size = vma->vm_end - vma->vm_start, |
555 | start = vma->vm_start, pos, page; | 575 | start = vma->vm_start, pos, page; |
556 | u32 i; | 576 | u32 i; |
577 | |||
578 | struct em2820 *dev = filp->private_data; | ||
579 | |||
557 | if (down_interruptible(&dev->fileop_lock)) | 580 | if (down_interruptible(&dev->fileop_lock)) |
558 | return -ERESTARTSYS; | 581 | return -ERESTARTSYS; |
559 | 582 | ||
@@ -1491,8 +1514,8 @@ static int em2820_video_do_ioctl(struct inode *inode, struct file *filp, | |||
1491 | static int em2820_v4l2_ioctl(struct inode *inode, struct file *filp, | 1514 | static int em2820_v4l2_ioctl(struct inode *inode, struct file *filp, |
1492 | unsigned int cmd, unsigned long arg) | 1515 | unsigned int cmd, unsigned long arg) |
1493 | { | 1516 | { |
1494 | struct em2820 *dev = video_get_drvdata(video_devdata(filp)); | ||
1495 | int ret = 0; | 1517 | int ret = 0; |
1518 | struct em2820 *dev = filp->private_data; | ||
1496 | 1519 | ||
1497 | if (down_interruptible(&dev->fileop_lock)) | 1520 | if (down_interruptible(&dev->fileop_lock)) |
1498 | return -ERESTARTSYS; | 1521 | return -ERESTARTSYS; |
@@ -1669,7 +1692,7 @@ static int em2820_init_dev(struct em2820 **devhandle, struct usb_device *udev, | |||
1669 | dev->vdev->release = video_device_release; | 1692 | dev->vdev->release = video_device_release; |
1670 | snprintf(dev->vdev->name, sizeof(dev->vdev->name), "%s", | 1693 | snprintf(dev->vdev->name, sizeof(dev->vdev->name), "%s", |
1671 | "em2820 video"); | 1694 | "em2820 video"); |
1672 | video_set_drvdata(dev->vdev, dev); | 1695 | list_add_tail(&dev->devlist,&em2820_devlist); |
1673 | 1696 | ||
1674 | /* register v4l2 device */ | 1697 | /* register v4l2 device */ |
1675 | down(&dev->lock); | 1698 | down(&dev->lock); |
@@ -1677,7 +1700,7 @@ static int em2820_init_dev(struct em2820 **devhandle, struct usb_device *udev, | |||
1677 | em2820_errdev("unable to register video device (error=%i).\n", | 1700 | em2820_errdev("unable to register video device (error=%i).\n", |
1678 | retval); | 1701 | retval); |
1679 | up(&dev->lock); | 1702 | up(&dev->lock); |
1680 | video_set_drvdata(dev->vdev, NULL); | 1703 | list_del(&dev->devlist); |
1681 | video_device_release(dev->vdev); | 1704 | video_device_release(dev->vdev); |
1682 | kfree(dev); | 1705 | kfree(dev); |
1683 | return -ENODEV; | 1706 | return -ENODEV; |
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h index c48354062eb6..5ff308261a7e 100644 --- a/drivers/media/video/em28xx/em28xx.h +++ b/drivers/media/video/em28xx/em28xx.h | |||
@@ -211,6 +211,7 @@ struct em2820 { | |||
211 | int model; /* index in the device_data struct */ | 211 | int model; /* index in the device_data struct */ |
212 | unsigned int is_em2800; | 212 | unsigned int is_em2800; |
213 | int video_inputs; /* number of video inputs */ | 213 | int video_inputs; /* number of video inputs */ |
214 | struct list_head devlist; | ||
214 | unsigned int has_tuner:1; | 215 | unsigned int has_tuner:1; |
215 | unsigned int has_msp34xx:1; | 216 | unsigned int has_msp34xx:1; |
216 | unsigned int has_tda9887:1; | 217 | unsigned int has_tda9887:1; |