Skip to content

Commit

Permalink
V4L/DVB (5552): Plan-b: Switch to refcounting PCI API
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Alan Cox authored and Mauro Carvalho Chehab committed Apr 27, 2007
1 parent 8ca966d commit 74ea1c7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/media/video/planb.c
Original file line number Diff line number Diff line change
Expand Up @@ -2207,7 +2207,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;
Expand Down Expand Up @@ -2237,13 +2237,15 @@ 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;

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;
}

Expand Down Expand Up @@ -2271,6 +2273,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);
}
Expand Down

0 comments on commit 74ea1c7

Please sign in to comment.