Thread (6 messages) flat view 6 messages, 3 authors, 2008-07-02

Re: [PATCH] powerpc/85xx: Add support for MPC8536DS

From: Chen Gong <hidden>
Date: 2008-07-02 15:27:14

Kumar Gala 写道:
On Jul 2, 2008, at 9:04 AM, Chen Gong wrote:
quoted
Stephen Rothwell 写道:
quoted
Hi Kumar,

On Wed, 2 Jul 2008 02:01:10 -0500 (CDT) Kumar Gala 
[off-list ref] wrote:
quoted
+void __init mpc8536_ds_pic_init(void)
+{
+    struct mpic *mpic;
+    struct resource r;
+    struct device_node *np = NULL;
You don't need to initialise this.
quoted
+    np = of_find_node_by_type(np, "open-pic");
+
Extra blank line.
quoted
+    if (np == NULL) {
+        printk(KERN_ERR "Could not find open-pic node\n");
+        return;
+    }
+
+    if (of_address_to_resource(np, 0, &r)) {
+        printk(KERN_ERR "Failed to map mpic register space\n");
+        of_node_put(np);
+        return;
+    }
+
+    mpic = mpic_alloc(np, r.start,
+              MPIC_PRIMARY | MPIC_WANTS_RESET |
+              MPIC_BIG_ENDIAN | MPIC_BROKEN_FRR_NIRQS,
+            0, 256, " OpenPIC  ");
+    BUG_ON(mpic == NULL);
+
+    mpic_init(mpic);
You leak a reference to np here.
It looks like there are same problem in other mpc85xx_xx.c files
agreed for the mpc85xx_ds.c, I dont see the _cds or _ads having these 
issues.
Yes, maybe I should write as mpc8xxx_xx.c, because it seems there is
the same problem in mpc8610_hpcd.c mpc86xx_hpcn.c etc.
- k
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help