diff options
author | Hans Verkuil | 2009-02-07 20:42:33 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab | 2009-03-30 12:42:42 -0300 |
commit | 230b65f9945b468c23188572144b4f066af8f98c (patch) | |
tree | a5d7da48908defc6e602a80c932fd06b9f8b7abd /drivers/media/common/saa7146_fops.c | |
parent | eae4d69b6a337d29060dcad3a4e19e3e8ace3e70 (diff) |
V4L/DVB (10502): saa7146: move v4l2 device registration to saa7146_vv.
Doing the v4l2_device registration in the saa7146 core will make it
dependent on v4l2, even for DVB-only boards. This registration and
unregistration belongs in saa7146_vv instead.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common/saa7146_fops.c')
-rw-r--r-- | drivers/media/common/saa7146_fops.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c index fec799d2600f..620f655fa9c5 100644 --- a/drivers/media/common/saa7146_fops.c +++ b/drivers/media/common/saa7146_fops.c @@ -446,11 +446,17 @@ static void vv_callback(struct saa7146_dev *dev, unsigned long status) int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv) { - struct saa7146_vv *vv = kzalloc(sizeof(struct saa7146_vv), GFP_KERNEL); + struct saa7146_vv *vv; + int err; + + err = v4l2_device_register(&dev->pci->dev, &dev->v4l2_dev); + if (err) + return err; + vv = kzalloc(sizeof(struct saa7146_vv), GFP_KERNEL); if (vv == NULL) { ERR(("out of memory. aborting.\n")); - return -1; + return -ENOMEM; } ext_vv->ops = saa7146_video_ioctl_ops; ext_vv->core_ops = &saa7146_video_ioctl_ops; @@ -496,6 +502,7 @@ int saa7146_vv_release(struct saa7146_dev* dev) DEB_EE(("dev:%p\n",dev)); + v4l2_device_unregister(&dev->v4l2_dev); pci_free_consistent(dev->pci, SAA7146_CLIPPING_MEM, vv->d_clipping.cpu_addr, vv->d_clipping.dma_handle); kfree(vv); dev->vv_data = NULL; |