summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci/zoran/zoran_card.c
diff options
context:
space:
mode:
authorHans Verkuil2015-07-20 15:18:21 +0200
committerMauro Carvalho Chehab2015-08-11 12:01:05 +0200
commite56c597b027ba95a9ce6719462793da4a91d27d2 (patch)
tree506dd6d435805d81fa21ddbcc8192ac2f5662a70 /drivers/media/pci/zoran/zoran_card.c
parent[media] zoran: use standard core lock (diff)
downloadkernel-qcow2-linux-e56c597b027ba95a9ce6719462793da4a91d27d2.tar.gz
kernel-qcow2-linux-e56c597b027ba95a9ce6719462793da4a91d27d2.tar.xz
kernel-qcow2-linux-e56c597b027ba95a9ce6719462793da4a91d27d2.zip
[media] zoran: convert to the control framework and to v4l2_fh
Switch this driver to the control framework and to v4l2_fh for handling control events. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/pci/zoran/zoran_card.c')
-rw-r--r--drivers/media/pci/zoran/zoran_card.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/pci/zoran/zoran_card.c b/drivers/media/pci/zoran/zoran_card.c
index afeca42da174..1136d92af642 100644
--- a/drivers/media/pci/zoran/zoran_card.c
+++ b/drivers/media/pci/zoran/zoran_card.c
@@ -1117,6 +1117,7 @@ static void zoran_remove(struct pci_dev *pdev)
pci_disable_device(zr->pci_dev);
video_unregister_device(zr->video_dev);
exit_free:
+ v4l2_ctrl_handler_free(&zr->hdl);
v4l2_device_unregister(&zr->v4l2_dev);
kfree(zr);
}
@@ -1220,6 +1221,9 @@ static int zoran_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
zr->pci_dev = pdev;
zr->id = nr;
snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "MJPEG[%u]", zr->id);
+ if (v4l2_ctrl_handler_init(&zr->hdl, 10))
+ goto zr_unreg;
+ zr->v4l2_dev.ctrl_handler = &zr->hdl;
spin_lock_init(&zr->spinlock);
mutex_init(&zr->lock);
if (pci_enable_device(pdev))
@@ -1443,6 +1447,7 @@ zr_free_irq:
zr_unmap:
iounmap(zr->zr36057_mem);
zr_unreg:
+ v4l2_ctrl_handler_free(&zr->hdl);
v4l2_device_unregister(&zr->v4l2_dev);
zr_free_mem:
kfree(zr);