Subject: Re: [PATCH 2/5] [POWERPC] QE: add support for QE USB clocks routing

From: Anton Vorontsov <[email-masked]>
Date: Fri, 18 Apr 2008 01:48:46 +0400

On Thu, Apr 17, 2008 at 02:56:42PM -0500, Timur Tabi wrote:
> Anton Vorontsov wrote:
> 
> > +config QE_USB
> > +	bool
> > +	help
> > +	  QE USB Host Controller support
> 
> Don't you need something like "depends on USB"?  I would assume that you need
> core USB support before any USB drivers can be loaded.

No, I'll add there "default y if USB_HCD_FHCI", but I'll do this at the
same time as USB_HCD_FHCI merges, because otherwise I would reference not
existent Kconfig symbol.

> > --- /dev/null
> > +++ b/arch/powerpc/sysdev/qe_lib/usb.c
> > @@ -0,0 +1,57 @@
> > +/*
> > + * QE USB routines
> > + *
> > + * Copyright (c) Freescale Semicondutor, Inc. 2006.
> > + *               Shlomi Gridish <[email-masked]>
> 
> Is this code from one of our BSPs?

Well, it is based on. I'm not sure that there is a single line of the
original code, but anyway I'd better be safe than remove someone's
copyright. The same applies to FSL GTM code.

> > +int qe_usb_clock_set(enum qe_clock clk, int rate)
> > +{
> > +	struct qe_mux __iomem *mux = &qe_immr->qmx;
> > +	unsigned long flags;
> > +	const bool is_brg = clk < QE_CLK1;
> 
> You don't really need "is_brg", since it's only used once.

Hm, no. This is code that speaks. More than that, I'd prefer this in
qe.h:

static inline bool qe_clock_is_brg(enum qe_clock clk)
{
	return clk < QE_CLK1;
}

:-)

-- 
Anton Vorontsov
email: [email-masked]
irc://irc.freenode.net/bd2