[PATCH] fsl_spi_init: Support non-QE processors
Grant Likely
grant.likely at secretlab.ca
Thu Oct 4 01:56:34 EST 2007
On 10/3/07, Peter Korsgaard <jacmet at sunsite.dk> wrote:
> On non-QE processors (mpc831x/mpc834x) the SPI clock is the SoC clock.
>
> Signed-off-by: Peter Korsgaard <jacmet at sunsite.dk>
> ---
> 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.
grant.likely at secretlab.ca
(403) 399-0195
More information about the Linuxppc-dev
mailing list