Thread (4 messages) flat view 4 messages, 3 authors, 2008-02-13

Re: [PATCH 2/2] powerpc: create mpc85xx pci err platform device for EDAC

From: Stephen Rothwell <hidden>
Date: 2008-02-11 23:32:53

Hi Dave,

On Mon, 11 Feb 2008 13:34:45 -0700 Dave Jiang [off-list ref] wrote:
quoted hunk ↗ jump to hunk
+++ b/arch/powerpc/sysdev/fsl_pci.c
+static int __init mpc85xx_pcierr_setup(void)
+{
+	struct device_node *np = NULL;
You don't need to initialiase this as it is first used in
for_each_compatible_node().
+	for_each_compatible_node(np, "pci", "fsl,mpc8540-pci") {
+		of_dev = of_find_device_by_node(np);
+		if (!of_dev)
+			return -ENODEV;
You need an of_node_put(np) before you return.
+		pdev = platform_device_alloc("mpc85xx_pci_err", id++);
+		if (!pdev)
+			return -ENOMEM;
And again.
+	}
+	return 0;
+
+error:
+	platform_device_put(pdev);
You need an of_node_put(np) here.
+	return err;
+}
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help