public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Olof Johansson <olof@lixom•net>
To: Kim Phillips <kim.phillips@freescale•com>
Cc: linuxppc-dev <linuxppc-dev@ozlabs•org>,
	Jerry Huang <Chang-Ming.Huang@freescale•com>
Subject: Re: [PATCH v2] powerpc: configure USB clock for MPC8315E
Date: Wed, 30 Jan 2008 11:27:57 -0600	[thread overview]
Message-ID: <20080130172757.GA18385@lixom.net> (raw)
In-Reply-To: <20080130110857.c66f98fb.kim.phillips@freescale.com>

Hi,

On Wed, Jan 30, 2008 at 11:08:57AM -0600, Kim Phillips wrote:
> diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c
> index 681230a..14c83f1 100644
> --- a/arch/powerpc/platforms/83xx/usb.c
> +++ b/arch/powerpc/platforms/83xx/usb.c
> @@ -124,10 +124,14 @@ int mpc831x_usb_cfg(void)
>  	}
>  
>  	/* Configure clock */
> -	temp = in_be32(immap + MPC83XX_SCCR_OFFS);
> -	temp &= ~MPC83XX_SCCR_USB_MASK;
> -	temp |= MPC83XX_SCCR_USB_DRCM_11;  /* 1:3 */
> -	out_be32(immap + MPC83XX_SCCR_OFFS, temp);
> +	if (of_find_compatible_node(NULL, NULL, "fsl,mpc8315-usb2-dr"))
> +		clrsetbits_be32(immap + MPC83XX_SCCR_OFFS,
> +		                MPC8315_SCCR_USB_MASK,
> +		                MPC8315_SCCR_USB_DRCM_11);

You need an of_node_put here.

Also, it's weird to check for the global presence of a compatible
device. You already have the device node pointer in the function, why
don't you just check to see if that device is compatible instead?


-Olof

      parent reply	other threads:[~2008-01-30 17:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-30 17:08 [PATCH v2] powerpc: configure USB clock for MPC8315E Kim Phillips
2008-01-30 17:24 ` Kumar Gala
2008-01-30 17:27 ` Olof Johansson [this message]

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=20080130172757.GA18385@lixom.net \
    --to=olof@lixom$(echo .)net \
    --cc=Chang-Ming.Huang@freescale$(echo .)com \
    --cc=kim.phillips@freescale$(echo .)com \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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