Merge branch 'linux-2.6' into for-2.6.22
[linux-drm-fsl-dcu.git] / drivers / media / video / planb.c
index e6e61df0d07198dcbc2735517ce2f5fe1a50ff8c..1455a8f4e930389133dd1801fa7e6327517d9365 100644 (file)
@@ -2210,7 +2210,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;
@@ -2240,6 +2240,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;
 
@@ -2247,6 +2248,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;
 }
 
@@ -2274,6 +2276,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);
        }