All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linuxppc-dev@ozlabs.org
Cc: Li Yang <leoli@freescale.com>, Paul <paulus@samba.org>
Subject: Re: [PATCH 1/3] add USB setup code for 8349emds PB
Date: Tue, 6 Feb 2007 14:17:52 +0100	[thread overview]
Message-ID: <200702061417.53446.arnd@arndb.de> (raw)
In-Reply-To: <45C844BF.8020805@freescale.com>

On Tuesday 06 February 2007 10:05, Li Yang wrote:
>  
> +static volatile u8 *bcsr_regs = NULL;

A 'static volatile u8*' type sounds very wrong. You use the variable
only in one function, so it should be local to that. There is normally
no reason to ever mark a variable volatile in driver code, instead
you want it to be '__iomem'. It should probably also be 'void *'
instead of 'u8 *', so it doesn't get dereferenced by accident.
Your references should be changed to use in_8/out_8 or readb/writeb,
depending on whether it's on-chip or PCI space.

> +	if ((np = of_find_compatible_node(np, "usb", "fsl-usb2-dr")) != NULL)
> +		port0_is_dr = 1;
> +	if ((np = of_find_compatible_node(np, "usb", "fsl-usb2-mph")) != NULL){
> +		if (port0_is_dr) {
> +			printk(KERN_WARNING
> +				"There is only one USB port on PB board! \n");
> +			return -1;
> +		} else if (!port0_is_dr)
> +			/* No usb port enabled */
> +			return -1;
> +	}

I'm not sure if scanning through the device tree to find mmio addresses
is still considered valid style. I would instead prefer you to provide a
of_platform_driver that attaches to the respective 'compatible' property
and does the register access in its probe() function in order to not
conflict with other drivers.

	Arnd <><

  reply	other threads:[~2007-02-06 13:18 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-06  9:05 [PATCH 1/3] add USB setup code for 8349emds PB Li Yang
2007-02-06 13:17 ` Arnd Bergmann [this message]
2007-02-07  2:22   ` Li Yang-r58472
2007-02-07  8:47     ` Arnd Bergmann
2007-02-07  9:16       ` Li Yang-r58472
2007-02-07 10:02         ` Arnd Bergmann
2007-02-07 10:10           ` Li Yang-r58472
2007-02-07 10:44             ` Arnd Bergmann
2007-02-07 16:10               ` Kumar Gala
2007-02-06 14:37 ` Kumar Gala
2007-02-06 16:31   ` Kumar Gala
2007-02-07  2:27     ` Li Yang-r58472
2007-02-07  4:09       ` Kumar Gala
2007-02-07  5:16   ` Li Yang-r58472
  -- strict thread matches above, loose matches on Subject: below --
2007-02-07  5:47 Li Yang
2007-02-08  6:46 ` Kumar Gala
2007-02-05  9:09 Li Yang
2007-02-05 15:04 ` Kumar Gala
2007-02-06  3:15   ` Li Yang-r58472
2007-02-06  3:30     ` Kumar Gala
2007-02-06  3:46       ` Li Yang-r58472
2007-02-06  4:01         ` Kumar Gala
2007-02-06  4:52           ` Li Yang-r58472
2007-02-06  5:00           ` Li Yang-r58472

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=200702061417.53446.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=leoli@freescale.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.