summaryrefslogtreecommitdiff
path: root/drivers/media/pci/saa7164/saa7164-core.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-06-12 05:49:50 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-21 11:03:39 -0300
commitd66de790c77b98589b93cb327bde2cddd2a4c2cc (patch)
treef026820dbfe9fc80208e6e2a4027aabc5a01f1d5 /drivers/media/pci/saa7164/saa7164-core.c
parentf1741fa8dd4a561e883cf60f103c40eda8790d80 (diff)
downloadlwn-d66de790c77b98589b93cb327bde2cddd2a4c2cc.tar.gz
lwn-d66de790c77b98589b93cb327bde2cddd2a4c2cc.zip
[media] saa7164: add v4l2_device and replace parent with v4l2_dev
This driver did not yet support struct v4l2_device, so add it. This make it possible to replace the deprecated parent field with the v4l2_dev field, allowing the eventual removal of the parent field. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/pci/saa7164/saa7164-core.c')
-rw-r--r--drivers/media/pci/saa7164/saa7164-core.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/media/pci/saa7164/saa7164-core.c b/drivers/media/pci/saa7164/saa7164-core.c
index 7618fdae811e..5d27865784c5 100644
--- a/drivers/media/pci/saa7164/saa7164-core.c
+++ b/drivers/media/pci/saa7164/saa7164-core.c
@@ -1196,6 +1196,11 @@ static int saa7164_initdev(struct pci_dev *pci_dev,
if (NULL == dev)
return -ENOMEM;
+ if (v4l2_device_register(&pci_dev->dev, &dev->v4l2_dev)) {
+ dev_err(&pci_dev->dev, "v4l2_device_register failed\n");
+ goto fail_free;
+ }
+
/* pci init */
dev->pci = pci_dev;
if (pci_enable_device(pci_dev)) {
@@ -1367,6 +1372,7 @@ fail_fw:
fail_irq:
saa7164_dev_unregister(dev);
fail_free:
+ v4l2_device_unregister(&dev->v4l2_dev);
kfree(dev);
return err;
}
@@ -1439,6 +1445,7 @@ static void saa7164_finidev(struct pci_dev *pci_dev)
mutex_unlock(&devlist);
saa7164_dev_unregister(dev);
+ v4l2_device_unregister(&dev->v4l2_dev);
kfree(dev);
}