On 10/3/07, Peter Korsgaard <[EMAIL PROTECTED]> wrote: > On non-QE processors (mpc831x/mpc834x) the SPI clock is the SoC clock. > > Signed-off-by: Peter Korsgaard <[EMAIL PROTECTED]> > --- > arch/powerpc/sysdev/fsl_soc.c | 27 +++++++++++++++++++-------- > 1 files changed, 19 insertions(+), 8 deletions(-) > > diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c > index a57fe56..59e4188 100644 > --- a/arch/powerpc/sysdev/fsl_soc.c > +++ b/arch/powerpc/sysdev/fsl_soc.c > @@ -1220,14 +1220,17 @@ int __init fsl_spi_init(struct spi_board_info > *board_infos, > { > struct device_node *np; > unsigned int i; > - const u32 *sysclk; > + const u32 *qe_sysclk = 0, *soc_sysclk = 0; > > np = of_find_node_by_type(NULL, "qe"); > - if (!np) > - return -ENODEV; > + if (np) > + qe_sysclk = of_get_property(np, "bus-frequency", NULL); > + > + np = of_find_node_by_type(NULL, "soc"); > + if (np) > + soc_sysclk = of_get_property(np, "bus-frequency", NULL);
Why not just: np = of_find_node_by_type(NULL, "qe"); + if (!np) + np = of_find_node_by_type(NULL, "soc"); if (!np) return -ENODEV; The other changes aren't needed that way. g. -- Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. [EMAIL PROTECTED] (403) 399-0195 _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev