diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2006-10-03 20:44:12 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-10-04 08:06:50 -0300 |
commit | e491cbc8b2eabc8856bf890006604edd91b1cce2 (patch) | |
tree | ded403fd4d2a7e159ba001c66a4373695629df42 /drivers/media/video/zoran_card.c | |
parent | a868b45dad04854e07bb1c7c81a73930098bc370 (diff) |
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.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/video/zoran_card.c b/drivers/media/video/zoran_card.c index 9f21d0ba0f0..653822ce391 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"); } |