[RFC] usb: ehci: use linux-way ehci_readl and ehci_writel

Sascha Hauer s.hauer at pengutronix.de
Thu Jul 24 00:03:47 PDT 2014


On Wed, Jul 23, 2014 at 09:14:08AM +0200, Sascha Hauer wrote:
> On Thu, Jul 17, 2014 at 03:54:07PM +0400, Antony Pavlov wrote:
> > Also drop nowhere defined CONFIG_EHCI_DESC_BIG_ENDIAN.
> > 
> > Signed-off-by: Antony Pavlov <antonynpavlov at gmail.com>
> 
> Applied, thanks

And reverted it.

> > -#if defined CONFIG_EHCI_DESC_BIG_ENDIAN
> > -#define	ehci_readl(x)		(*((volatile u32 *)(x)))
> > -#define ehci_writel(a, b)	(*((volatile u32 *)(a)) = ((volatile u32)b))
> > -#else
> > -#define ehci_readl(x)		cpu_to_le32((*((volatile u32 *)(x))))
> > -#define ehci_writel(a, b)	(*((volatile u32 *)(a)) = \
> > -					cpu_to_le32(((volatile u32)b)))
> > -#endif
> > +static inline void ehci_writel(const unsigned int val, __u32 __iomem *regs)
> > +{
> > +	writel(val, regs);
> > +}

ehci_writel has the argument order (reg, val), not (val, reg)

Putting a 'writel' in a function name with this argument order wasn't
the best idea...

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list