]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/planb.c
Merge git://git.linux-nfs.org/pub/linux/nfs-2.6
[linux-2.6-omap-h63xx.git] / drivers / media / video / planb.c
index e6e61df0d07198dcbc2735517ce2f5fe1a50ff8c..0ef73d9d5848554054889c5b83540db000b3fc7a 100644 (file)
@@ -353,9 +353,8 @@ static int planb_prepare_open(struct planb *pb)
                * PLANB_DUMMY)*sizeof(struct dbdma_cmd)
                +(PLANB_MAXLINES*((PLANB_MAXPIXELS+7)& ~7))/8
                +MAX_GBUFFERS*sizeof(unsigned int);
-       if ((pb->priv_space = kmalloc (size, GFP_KERNEL)) == 0)
+       if ((pb->priv_space = kzalloc (size, GFP_KERNEL)) == 0)
                return -ENOMEM;
-       memset ((void *) pb->priv_space, 0, size);
        pb->overlay_last1 = pb->ch1_cmd = (volatile struct dbdma_cmd *)
                                                DBDMA_ALIGN (pb->priv_space);
        pb->overlay_last2 = pb->ch2_cmd = pb->ch1_cmd + pb->tab_size;
@@ -845,21 +844,21 @@ cmd_tab_mask_end:
 /*********************************/
 
 static int palette2fmt[] = {
-       0,
-       PLANB_GRAY,
-       0,
-       0,
-       0,
-       PLANB_COLOUR32,
-       PLANB_COLOUR15,
-       0,
-       0,
-       0,
-       0,
-       0,
-       0,
-       0,
-       0,
+       0,
+       PLANB_GRAY,
+       0,
+       0,
+       0,
+       PLANB_COLOUR32,
+       PLANB_COLOUR15,
+       0,
+       0,
+       0,
+       0,
+       0,
+       0,
+       0,
+       0,
 };
 
 #define PLANB_PALETTE_MAX 15
@@ -2210,7 +2209,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 +2239,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 +2247,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 +2275,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);
        }