linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Grant Likely" <grant.likely@secretlab.ca>
To: "Peter Korsgaard" <jacmet@sunsite.dk>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] fsl_spi_init: Support non-QE processors
Date: Wed, 3 Oct 2007 09:56:34 -0600	[thread overview]
Message-ID: <fa686aa40710030856u74054993q2d73cf18920665f2@mail.gmail.com> (raw)
In-Reply-To: <87lkakxky1.fsf@macbook.be.48ers.dk>

On 10/3/07, Peter Korsgaard <jacmet@sunsite.dk> wrote:
> On non-QE processors (mpc831x/mpc834x) the SPI clock is the SoC clock.
>
> Signed-off-by: Peter Korsgaard <jacmet@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@secretlab.ca
(403) 399-0195

  reply	other threads:[~2007-10-03 15:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-03 15:43 [PATCH] fsl_spi_init: Support non-QE processors Peter Korsgaard
2007-10-03 15:56 ` Grant Likely [this message]
2007-10-03 16:04   ` Peter Korsgaard
2007-10-03 18:17     ` Grant Likely
2007-10-03 22:11       ` Kumar Gala
2007-10-04  4:01 ` Stephen Rothwell
2007-10-05 14:11   ` Kumar Gala
2007-10-06 20:06     ` Peter Korsgaard
2007-10-08 14:09       ` Kumar Gala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fa686aa40710030856u74054993q2d73cf18920665f2@mail.gmail.com \
    --to=grant.likely@secretlab.ca \
    --cc=jacmet@sunsite.dk \
    --cc=linuxppc-dev@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).