[U-Boot] [PATCH] usbtty/omap: update to current API

Wolfgang Denk wd at denx.de
Sun Nov 9 20:59:30 CET 2008


Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <1226254923-8378-1-git-send-email-plagnioj at jcrosoft.com> you wrote:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>

Please explain what exactly you are trying to change / fix here.

> diff --git a/drivers/serial/usbtty.c b/drivers/serial/usbtty.c
> index e738c56..448defa 100644
> --- a/drivers/serial/usbtty.c
> +++ b/drivers/serial/usbtty.c
> @@ -22,14 +22,13 @@
>   */
>  
>  #include <common.h>
> -
> +#include <config.h>		/* If defined, override Linux identifiers with
> +				 * vendor specific ones */

"If defined" - what needs to be defined to have any impact here?

And why do we care about Linux identifiers here? That's U-Boot, not
Linux.

> +#ifndef CONFIG_USBD_VENDORID
>  #define CONFIG_USBD_VENDORID 0x0525	/* Linux/NetChip */
> +#endif
> +#ifndef CONFIG_USBD_PRODUCTID_GSERIAL
>  #define CONFIG_USBD_PRODUCTID_GSERIAL 0xa4a6	/* gserial */
> +#endif
> +#ifndef CONFIG_USBD_PRODUCTID_CDCACM
>  #define CONFIG_USBD_PRODUCTID_CDCACM  0xa4a7	/* CDC ACM */
> +#endif
> +#ifndef CONFIG_USBD_MANUFACTURER
>  #define CONFIG_USBD_MANUFACTURER "Das U-Boot"
> +#endif
> +#ifndef CONFIG_USBD_PRODUCT_NAME
>  #define CONFIG_USBD_PRODUCT_NAME U_BOOT_VERSION
> +#endif
>  
> -
> +#ifndef CONFIG_USBD_CONFIGURATION_STR
>  #define CONFIG_USBD_CONFIGURATION_STR "TTY via USB"
> +#endif

All these new config options need to be documented in the README.

>  /* Called to start packet transmission. */
> -void udc_endpoint_write (struct usb_endpoint_instance *endpoint)
> +int udc_endpoint_write (struct usb_endpoint_instance *endpoint)
>  {
>  	unsigned short epnum =
>  		endpoint->endpoint_address & USB_ENDPOINT_NUMBER_MASK;
> @@ -1081,6 +1081,8 @@ void udc_endpoint_write (struct usb_endpoint_instance *endpoint)
>  		/* deselect the endpoint FIFO */
>  		outw (UDC_EP_Dir | epnum, UDC_EP_NUM);
>  	}
> +
> +	return 0;
>  }

If the only way to exit the function is by returning 0  at  the  end,
then  we should rather leave this as is and have this function return
void - otherwise we suggest that different values could  be  returned
which is not the case.



Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It is practically impossible to teach good programming style to  stu-
dents that have had prior exposure to BASIC: as potential programmers
they are mentally mutilated beyond hope of regeneration.   - Dijkstra


More information about the U-Boot mailing list