]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/planb.c
Pull battery into release branch
[linux-2.6-omap-h63xx.git] / drivers / media / video / planb.c
index fe184f93c016a12d6b2661f926041ba8fc7db86d..4ab1af74a97027f3ecf9503a6d763e44df520492 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;
@@ -2160,7 +2159,7 @@ static int find_planb(void)
        if (!machine_is(powermac))
                return 0;
 
-       planb_devices = find_devices("planb");
+       planb_devices = of_find_node_by_name(NULL, "planb");
        if (planb_devices == 0) {
                planb_num=0;
                printk(KERN_WARNING "PlanB: no device found!\n");
@@ -2175,12 +2174,14 @@ static int find_planb(void)
        if (planb_devices->n_addrs != 1) {
                printk (KERN_WARNING "PlanB: expecting 1 address for planb "
                        "(got %d)", planb_devices->n_addrs);
+               of_node_put(planb_devices);
                return 0;
        }
 
        if (planb_devices->n_intrs == 0) {
                printk(KERN_WARNING "PlanB: no intrs for device %s\n",
                       planb_devices->full_name);
+               of_node_put(planb_devices);
                return 0;
        } else {
                irq = planb_devices->intrs[0].line;
@@ -2202,6 +2203,7 @@ static int find_planb(void)
        confreg = planb_devices->addrs[0].space & 0xff;
        old_base = planb_devices->addrs[0].address;
        new_base = 0xf1000000;
+       of_node_put(planb_devices);
 
        DEBUG("PlanB: Found on bus %d, dev %d, func %d, "
                "membase 0x%x (base reg. 0x%x)\n",