* [PATCH] USB speedtouch: handle failure of usb_set_interface.
@ 2003-03-26 17:04 Duncan Sands
2003-03-28 22:15 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Duncan Sands @ 2003-03-26 17:04 UTC (permalink / raw)
To: linux-usb-devel; +Cc: Greg KH, linux-kernel
speedtch.c | 26 ++++++++++++++++++--------
1 files changed, 18 insertions(+), 8 deletions(-)
diff -Nru a/drivers/usb/misc/speedtch.c b/drivers/usb/misc/speedtch.c
--- a/drivers/usb/misc/speedtch.c Wed Mar 26 18:02:57 2003
+++ b/drivers/usb/misc/speedtch.c Wed Mar 26 18:02:57 2003
@@ -1034,6 +1034,23 @@
** USB **
**********/
+static int udsl_set_alternate (struct udsl_instance_data *instance)
+{
+ down (&instance->serialize); /* vs self */
+ if (!instance->firmware_loaded) {
+ int ret;
+
+ if ((ret = usb_set_interface (instance->usb_dev, 1, 1)) < 0) {
+ up (&instance->serialize);
+ return ret;
+ }
+ instance->firmware_loaded = 1;
+ }
+ up (&instance->serialize);
+ udsl_fire_receivers (instance);
+ return 0;
+}
+
static int udsl_usb_ioctl (struct usb_interface *intf, unsigned int code, void *user_data)
{
struct udsl_instance_data *instance = usb_get_intfdata (intf);
@@ -1048,14 +1065,7 @@
switch (code) {
case UDSL_IOCTL_START:
instance->atm_dev->signal = ATM_PHY_SIG_FOUND;
- down (&instance->serialize); /* vs self */
- if (!instance->firmware_loaded) {
- usb_set_interface (instance->usb_dev, 1, 1);
- instance->firmware_loaded = 1;
- }
- up (&instance->serialize);
- udsl_fire_receivers (instance);
- return 0;
+ return udsl_set_alternate (instance);
case UDSL_IOCTL_STOP:
instance->atm_dev->signal = ATM_PHY_SIG_LOST;
return 0;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] USB speedtouch: handle failure of usb_set_interface.
2003-03-26 17:04 [PATCH] USB speedtouch: handle failure of usb_set_interface Duncan Sands
@ 2003-03-28 22:15 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2003-03-28 22:15 UTC (permalink / raw)
To: Duncan Sands; +Cc: linux-usb-devel, linux-kernel
On Wed, Mar 26, 2003 at 06:04:59PM +0100, Duncan Sands wrote:
> speedtch.c | 26 ++++++++++++++++++--------
> 1 files changed, 18 insertions(+), 8 deletions(-)
Applied, thanks.
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-03-28 22:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-26 17:04 [PATCH] USB speedtouch: handle failure of usb_set_interface Duncan Sands
2003-03-28 22:15 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®