On Wed, 19 Dec 2007 23:38:05 +0300 Anton Vorontsov <[EMAIL PROTECTED]> wrote:
>
> +++ b/arch/powerpc/sysdev/fsl_soc.c
> @@ -1227,15 +1227,19 @@ int __init fsl_spi_init(struct spi_board_info 
> *board_infos,
>  
>       /* SPI controller is either clocked from QE or SoC clock */
>       np = of_find_compatible_node(NULL, NULL, "fsl,qe");
> -     if (!np)
> +     if (np) {
> +             sysclk = of_get_property(np, "brg-frequency", NULL);
> +             if (!sysclk)
> +                     return -ENODEV;

You need an of_node_put(np) in the failing case.

> +     } else {
>               np = of_find_node_by_type(NULL, "soc");
> +             if (!np)
> +                     return -ENODEV;
>  
> -     if (!np)
> -             return -ENODEV;
> -
> -     sysclk = of_get_property(np, "bus-frequency", NULL);
> -     if (!sysclk)
> -             return -ENODEV;
> +             sysclk = of_get_property(np, "bus-frequency", NULL);
> +             if (!sysclk)
> +                     return -ENODEV;

And again.

> +     }
>  
>       for (np = NULL, i = 1;

There should be an of_node_put(np) before this as well.

-- 
Cheers,
Stephen Rothwell                    [EMAIL PROTECTED]
http://www.canb.auug.org.au/~sfr/

Attachment: pgpGmmHC0cypT.pgp
Description: PGP signature

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev

Reply via email to