summaryrefslogtreecommitdiff
path: root/drivers/media/video/zoran_card.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-10-03 23:44:12 (GMT)
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-10-04 11:06:50 (GMT)
commite491cbc8b2eabc8856bf890006604edd91b1cce2 (patch)
treeded403fd4d2a7e159ba001c66a4373695629df42 /drivers/media/video/zoran_card.c
parenta868b45dad04854e07bb1c7c81a73930098bc370 (diff)
downloadlinux-fsl-qoriq-e491cbc8b2eabc8856bf890006604edd91b1cce2.tar.xz
V4L/DVB (4707): 4linux: complete conversion to hotplug safe PCI API
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/zoran_card.c')
-rw-r--r--drivers/media/video/zoran_card.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/video/zoran_card.c b/drivers/media/video/zoran_card.c
index 9f21d0b..653822c 100644
--- a/drivers/media/video/zoran_card.c
+++ b/drivers/media/video/zoran_card.c
@@ -1278,9 +1278,7 @@ find_zr36057 (void)
zoran_num = 0;
while (zoran_num < BUZ_MAX &&
- (dev =
- pci_find_device(PCI_VENDOR_ID_ZORAN,
- PCI_DEVICE_ID_ZORAN_36057, dev)) != NULL) {
+ (dev = pci_get_device(PCI_VENDOR_ID_ZORAN, PCI_DEVICE_ID_ZORAN_36057, dev)) != NULL) {
card_num = card[zoran_num];
zr = &zoran[zoran_num];
memset(zr, 0, sizeof(struct zoran)); // Just in case if previous cycle failed
@@ -1541,7 +1539,8 @@ find_zr36057 (void)
goto zr_detach_vfe;
}
}
-
+ /* Success so keep the pci_dev referenced */
+ pci_dev_get(zr->pci_dev);
zoran_num++;
continue;
@@ -1563,6 +1562,9 @@ find_zr36057 (void)
iounmap(zr->zr36057_mem);
continue;
}
+ if (dev) /* Clean up ref count on early exit */
+ pci_dev_put(dev);
+
if (zoran_num == 0) {
dprintk(1, KERN_INFO "No known MJPEG cards found.\n");
}