summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-04-23 17:57:28 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-04-23 17:57:28 -0300
commit6deaa5ff95d4836c569d26ec24174bbd2c591695 (patch)
treeb4faf607adfd16a2e70d36c4ef0de49c077f8d7e /linux/drivers
parent1327dcf75b55fe45beeb3fab77fd1383f643f538 (diff)
downloadmediapointer-dvb-s2-6deaa5ff95d4836c569d26ec24174bbd2c591695.tar.gz
mediapointer-dvb-s2-6deaa5ff95d4836c569d26ec24174bbd2c591695.tar.bz2
Plan-b: Switch to refcounting PCI API
From: Alan Cox <alan@lxorguk.ukuu.org.uk> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/planb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/linux/drivers/media/video/planb.c b/linux/drivers/media/video/planb.c
index c393b26e1..c6f2dc6cf 100644
--- a/linux/drivers/media/video/planb.c
+++ b/linux/drivers/media/video/planb.c
@@ -2216,7 +2216,7 @@ static int find_planb(void)
"membase 0x%x (base reg. 0x%x)\n",
bus, PCI_SLOT(dev_fn), PCI_FUNC(dev_fn), old_base, confreg);
- pdev = pci_find_slot (bus, dev_fn);
+ pdev = pci_get_bus_and_slot(bus, dev_fn);
if (!pdev) {
printk(KERN_ERR "planb: cannot find slot\n");
goto err_out;
@@ -2246,6 +2246,7 @@ static int find_planb(void)
pb->planb_base = planb_regs;
pb->planb_base_phys = (struct planb_registers *)new_base;
pb->irq = irq;
+ pb->dev = pdev;
return planb_num;
@@ -2253,6 +2254,7 @@ err_out_disable:
pci_disable_device(pdev);
err_out:
/* FIXME handle error */ /* comment moved from pci_find_slot, above */
+ pci_dev_put(pdev);
return 0;
}
@@ -2280,6 +2282,8 @@ static void release_planb(void)
printk(KERN_INFO "PlanB: unregistering with v4l\n");
video_unregister_device(&pb->video_dev);
+ pci_dev_put(pb->dev);
+
/* note that iounmap() does nothing on the PPC right now */
iounmap ((void *)pb->planb_base);
}