Re: [PATCH v5 02/10] USB: io_ti: Add timeout parameter to ti_vsend_sync()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jun 15, 2015 at 10:47:25AM -0500, Peter E. Berger wrote:
> From: "Peter E. Berger" <pberger@xxxxxxxxxxx>
> 
> Instead of having ti_vsend_sync() decide when to use non-default timeouts,
> make "timeout" a parameter and leave the decision to the caller.
> 
> Signed-off-by: Peter E. Berger <pberger@xxxxxxxxxxx>
> ---
>  drivers/usb/serial/io_ti.c | 28 +++++++++++++++++-----------
>  1 file changed, 17 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c
> index 3206a6f..75f08c3 100644
> --- a/drivers/usb/serial/io_ti.c
> +++ b/drivers/usb/serial/io_ti.c
> @@ -210,6 +210,10 @@ static int edge_create_sysfs_attrs(struct usb_serial_port *port);
>  static int edge_remove_sysfs_attrs(struct usb_serial_port *port);
>  
>  
> +/* Timeouts in msecs: firmware downloads take longer */
> +#define TI_VSEND_TIMEOUT_DEFAULT 1000
> +#define TI_VSEND_TIMEOUT_FW_DOWNLOAD 10000
> +
>  static int ti_vread_sync(struct usb_device *dev, __u8 request,
>  				__u16 value, __u16 index, u8 *data, int size)
>  {
> @@ -228,14 +232,11 @@ static int ti_vread_sync(struct usb_device *dev, __u8 request,
>  	return 0;
>  }
>  
> -static int ti_vsend_sync(struct usb_device *dev, __u8 request,
> +static int ti_vsend_sync(struct usb_device *dev, __u8 request, int timeout,
>  				__u16 value, __u16 index, u8 *data, int size)

So merge this one with the first patch. Also add the timeout argument
at the end of the argument list to match the USB API.

Thanks,
Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux