Thread (10 messages) 10 messages, 7 authors, 2007-02-12

Re: [PATCH] mfd: SM501 core driver

From: Ben Dooks <ben-linux@fluff.org>
Date: 2007-02-07 17:10:11
Also in: lkml

On Wed, Feb 07, 2007 at 08:52:25AM -0800, Andrew Morton wrote:
On Wed, 7 Feb 2007 11:48:25 +0000 Ben Dooks [off-list ref] wrote:
quoted
On Tue, Feb 06, 2007 at 09:09:30PM -0800, Andrew Morton wrote:
quoted
On Tue, 6 Feb 2007 19:26:28 +0000 Ben Dooks [off-list ref] wrote:
quoted
This patch is an update patch, ready for merging
for the Silicon Motion SM501 multi-function device
core.

This driver handles the core function of the chip,
including the clock, power control and allocation
of resources for drivers. It also exports a series
of platform devices for the function drivers to
attach to.

This patch supports both platform and PCI bus
attached devices.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Can we get Vincent's signoff here?
quoted
+#ifdef CONFIG_DEBUG
This doesn't appear to be defined anywhere, and nor should it be. 
Something subsystem-specific should be used here?
This protects the code being used by dev_dbg() only from being
warned as not being used.
I know what is does, but I query the use of "CONFIG_DEBUG".  I don't think
there's a CONFIG_DEBUG defined in existing Kconfig, and your patch doesn't
add a CONFIG_DEBUG and nor should it, because that would be an
inappropriate identifier to use.

So I'd suggest you just use DEBUG, as many other drivers do.  Or call it
CONFIG_SM501_DEBUG and add the Kconfig record to enable it.
You are right, too used to adding CONFIG_ from playing with Kconfig
 
quoted
quoted
quoted
+#define fmt_freq(x) ((x) / MHZ), ((x) % MHZ), (x)
eww.
Do you have a better way of printing a nice formatted MHz with
fractional parts?
Nope.
quoted
 Is it going to be necessary to remove this?
Nope.  But ewww.
quoted
quoted
quoted
+		(void)readl(sm->regs);
Is there any benefit in all those casts?  Generally we prefer to avoid
them.
I thoguht they where necessary to stop the compiler optimising
away the readl() ?
No, that shuldn't be necessary.  If it was, the compiler would optimise
away the first readl() in 

	my_local = readl(foo);
	my_local = readl(bar);

which would break stuff.  readl() implementations use volatile to prevent
this.
Ok, i've moved these into their own function called
sm501_sync_regs() to make it more explicit what it is
being used for.

-- 
Ben (ben@fluff.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help