linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Grant Likely <grant.likely@secretlab.ca>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH V2] [POWERPC] Add common clock setting routine mpc52xx_psc_set_clkdiv()
Date: Wed, 9 Jan 2008 17:37:41 +1100	[thread overview]
Message-ID: <20080109173741.02a32a2a.sfr@canb.auug.org.au> (raw)
In-Reply-To: <20080109050950.14630.17832.stgit@trillian.secretlab.ca>

[-- Attachment #1: Type: text/plain, Size: 1780 bytes --]

Hi Grant,

Just a couple of trivial things.

On Tue, 08 Jan 2008 22:09:50 -0700 Grant Likely <grant.likely@secretlab.ca> wrote:
>
> +int mpc52xx_set_psc_clkdiv(int psc_id, int clkdiv)

> +	switch (psc_id) {
> +	  case 1: reg = &mpc52xx_cdm->mclken_div_psc1; mask = 0x20; break;
> +	  case 2: reg = &mpc52xx_cdm->mclken_div_psc2; mask = 0x40; break;
> +	  case 3: reg = &mpc52xx_cdm->mclken_div_psc3; mask = 0x80; break;
> +	  case 6: reg = &mpc52xx_cdm->mclken_div_psc6; mask = 0x10; break;
> +	  default:
> +		return -ENODEV;
> +	}

We line up case labels with the switch statement itself.

> +int mpc52xx_set_psc_clkdiv(int psc_id, int clkdiv)

> +	switch (psc_id) {
> +	  case 1: reg = &cdm->mclken_div_psc1; mask = 0x20; break;
> +	  case 2: reg = &cdm->mclken_div_psc2; mask = 0x40; break;
> +	  case 3: reg = &cdm->mclken_div_psc3; mask = 0x80; break;
> +	  case 6: reg = &cdm->mclken_div_psc6; mask = 0x10; break;
> +	  default:
> +	  	return -ENODEV;
> +	}

Here as well.

> +++ b/include/asm-powerpc/mpc52xx.h
> -extern void mpc5200_setup_xlb_arbiter(void);
> -extern void mpc52xx_declare_of_platform_devices(void);
> +extern void __init mpc5200_setup_xlb_arbiter(void);
> +extern void __init mpc52xx_declare_of_platform_devices(void);
> +extern void __init mpc52xx_map_common_devices(void);

We don't mark things __init in header files.  It is unnecessary and can
get out of sync - which causes unexpected results.

> +/* mpc52xx_pci.c */
>  #ifdef CONFIG_PCI
>  extern int __init mpc52xx_add_bridge(struct device_node *node);
>  extern void __init mpc52xx_setup_pci(void);

I see where yours above came from ...

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

      reply	other threads:[~2008-01-09  6:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-09  5:09 [PATCH V2] [POWERPC] Add common clock setting routine mpc52xx_psc_set_clkdiv() Grant Likely
2008-01-09  6:37 ` Stephen Rothwell [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=20080109173741.02a32a2a.sfr@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=grant.likely@secretlab.ca \
    --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).