diff options
| author | Ingo Molnar <mingo@elte.hu> | 2009-03-01 12:48:28 +0100 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-03-01 12:48:28 +0100 |
| commit | 645af4e9e0e32481e3336dda813688732c7e5f0f (patch) | |
| tree | 931b31f3b6e0879df0f9a1d58ffd040d9a652f2e /drivers/usb/core/message.c | |
| parent | ecc25fbd6b9e07b33895c61ddf84006b00f55d99 (diff) | |
| parent | 55f2b78995826d549401bdf20abeac1832636bb6 (diff) | |
Merge branch 'x86/pat' into x86/core
Diffstat (limited to 'drivers/usb/core/message.c')
| -rw-r--r-- | drivers/usb/core/message.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 31fb204f44c..49e7f56e0d7 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -653,7 +653,7 @@ int usb_get_descriptor(struct usb_device *dev, unsigned char type, if (result <= 0 && result != -ETIMEDOUT) continue; if (result > 1 && ((u8 *)buf)[1] != type) { - result = -EPROTO; + result = -ENODATA; continue; } break; @@ -696,8 +696,13 @@ static int usb_get_string(struct usb_device *dev, unsigned short langid, USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, (USB_DT_STRING << 8) + index, langid, buf, size, USB_CTRL_GET_TIMEOUT); - if (!(result == 0 || result == -EPIPE)) - break; + if (result == 0 || result == -EPIPE) + continue; + if (result > 1 && ((u8 *) buf)[1] != USB_DT_STRING) { + result = -ENODATA; + continue; + } + break; } return result; } |
