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

Stephen Rothwell sfr at canb.auug.org.au
Tue Feb 12 10:32:43 EST 2008


Hi Dave,

On Mon, 11 Feb 2008 13:34:45 -0700 Dave Jiang <djiang at mvista.com> wrote:
>
> +++ 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 at canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20080212/7559379c/attachment.pgp>


More information about the Linuxppc-dev mailing list