Commit 74ea1c7a authored by Alan Cox's avatar Alan Cox Committed by Mauro Carvalho Chehab

V4L/DVB (5552): Plan-b: Switch to refcounting PCI API

Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@infradead.org>
parent 8ca966d7
...@@ -2207,7 +2207,7 @@ static int find_planb(void) ...@@ -2207,7 +2207,7 @@ static int find_planb(void)
"membase 0x%x (base reg. 0x%x)\n", "membase 0x%x (base reg. 0x%x)\n",
bus, PCI_SLOT(dev_fn), PCI_FUNC(dev_fn), old_base, confreg); 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) { if (!pdev) {
printk(KERN_ERR "planb: cannot find slot\n"); printk(KERN_ERR "planb: cannot find slot\n");
goto err_out; goto err_out;
...@@ -2237,6 +2237,7 @@ static int find_planb(void) ...@@ -2237,6 +2237,7 @@ static int find_planb(void)
pb->planb_base = planb_regs; pb->planb_base = planb_regs;
pb->planb_base_phys = (struct planb_registers *)new_base; pb->planb_base_phys = (struct planb_registers *)new_base;
pb->irq = irq; pb->irq = irq;
pb->dev = pdev;
return planb_num; return planb_num;
...@@ -2244,6 +2245,7 @@ static int find_planb(void) ...@@ -2244,6 +2245,7 @@ static int find_planb(void)
pci_disable_device(pdev); pci_disable_device(pdev);
err_out: err_out:
/* FIXME handle error */ /* comment moved from pci_find_slot, above */ /* FIXME handle error */ /* comment moved from pci_find_slot, above */
pci_dev_put(pdev);
return 0; return 0;
} }
...@@ -2271,6 +2273,8 @@ static void release_planb(void) ...@@ -2271,6 +2273,8 @@ static void release_planb(void)
printk(KERN_INFO "PlanB: unregistering with v4l\n"); printk(KERN_INFO "PlanB: unregistering with v4l\n");
video_unregister_device(&pb->video_dev); video_unregister_device(&pb->video_dev);
pci_dev_put(pb->dev);
/* note that iounmap() does nothing on the PPC right now */ /* note that iounmap() does nothing on the PPC right now */
iounmap ((void *)pb->planb_base); iounmap ((void *)pb->planb_base);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment