[U-Boot] [RFC] [UBOOT] [PATCH v2 2/4] USB: Adapt the usb-compat.h to uboot and fix compiler errors

Tom Rini trini at ti.com
Mon Jun 24 22:16:23 CEST 2013


On Mon, Jun 24, 2013 at 11:43:53AM -0500, Dan Murphy wrote:

> Adapt the usb-compat.h to uBoot.
> 
> Use #ifndef __UBOOT__ for code that is not applicable to uBoot.
> Use #ifdef __UBOOT__ to add code that is uBoot specific.
> 
> Create linux-compat.h - Linux kernel compatibility definitions that do not
> exist in the uBoot.  Moved the compatibility definitions from lin_gadget_compat.h
> to this file as well.
> 
> Create usb-mod-devicetable.h - Is a partial back port of mod_devicetable.h in the linux
> kernel only taking the portion needed for USB
> 
> Already existing header files were modified to pick up the new header files.
[snip]
> +++ b/include/linux/usb/linux-compat.h
[snip]
> +#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))

This is already in <common.h>

> diff --git a/include/linux/usb/usb-compat.h b/include/linux/usb/usb-compat.h
> index a0bee5a..a46d1e6 100644
> --- a/include/linux/usb/usb-compat.h
> +++ b/include/linux/usb/usb-compat.h
[snip]
> @@ -1770,10 +1903,16 @@ usb_maxpacket(struct usb_device *udev, int pipe, int is_out)
>  	unsigned			epnum = usb_pipeendpoint(pipe);
>  
>  	if (is_out) {
> +#ifndef __UBOOT__
> +		/* Fix this warning */
>  		WARN_ON(usb_pipein(pipe));
> +#endif
>  		ep = udev->ep_out[epnum];
>  	} else {
> +#ifndef __UBOOT__
> +		/* Fix this warning */
>  		WARN_ON(usb_pipeout(pipe));
> +#endif

Are these warnings that aren't applicable to us, or things that need to
be fixed as part of the series, eventually?

But, in general, as this is the approach I suggested, I'm fine with it.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130624/bd50b46e/attachment.pgp>


More information about the U-Boot mailing list