From: Mike Isely <[EMAIL PROTECTED]>

Fix usb core function error return checks to look for negative errno
values, not positive errno values.  This bug had rendered those checks
useless.  Also remove attempted error recovery on control endpoints
for EPIPE - with control endpoints EPIPE does not indicate a halted
endpoint so trying to recover with usb_clear_halt() is not the correct
action.

Signed-off-by: Mike Isely <[EMAIL PROTECTED]>

---

This patch series is baselined against vanilla kernel 2.6.18-rc4 plus
the previous 2 patches in this set.

 cypress_m8.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff -uprN -X linux-2.6.18-rc4/Documentation/dontdiff 
p2/drivers/usb/serial/cypress_m8.c p3/drivers/usb/serial/cypress_m8.c
--- p2/drivers/usb/serial/cypress_m8.c  2006-08-26 12:45:45.000000000 -0500
+++ p3/drivers/usb/serial/cypress_m8.c  2006-08-26 12:49:59.000000000 -0500
@@ -367,9 +367,7 @@ static int cypress_serial_control (struc
                                if (tries++ >= 3)
                                        break;
 
-                               if (retval == EPIPE)
-                                       usb_clear_halt(port->serial->dev, 0x00);
-                       } while (retval != 8 && retval != ENODEV);
+                       } while (retval != 8 && retval != -ENODEV);
 
                        if (retval != 8)
                                err("%s - failed sending serial line settings - 
%d", __FUNCTION__, retval);
@@ -394,9 +392,7 @@ static int cypress_serial_control (struc
                                if (tries++ >= 3)
                                        break;
 
-                               if (retval == EPIPE)
-                                       usb_clear_halt(port->serial->dev, 0x00);
-                       } while (retval != 5 && retval != ENODEV);
+                       } while (retval != 5 && retval != -ENODEV);
 
                        if (retval != 5) {
                                err("%s - failed to retrieve serial line 
settings - %d", __FUNCTION__, retval);

-- 
                        |         Mike Isely          |     PGP fingerprint
     Spammers Die!!     |                             | 03 54 43 4D 75 E5 CC 92
                        |   isely @ pobox (dot) com   | 71 16 01 E2 B5 F5 C1 E8
                        |                             |

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to