Commit 48d87ba2 authored by David Brownell's avatar David Brownell Committed by Greg Kroah-Hartman

[PATCH] USB: retry string fetches on ZLPs not just STALLs

This matches the behavior for other descriptor fetches.
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 33f30a20
...@@ -1320,7 +1320,7 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size) ...@@ -1320,7 +1320,7 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size)
*/ */
err = usb_get_string(dev, dev->string_langid, index, tbuf, 2); err = usb_get_string(dev, dev->string_langid, index, tbuf, 2);
if (err == -EPIPE) { if (err == -EPIPE || err == 0) {
dev_dbg(&dev->dev, "RETRY string %d read/%d\n", index, 2); dev_dbg(&dev->dev, "RETRY string %d read/%d\n", index, 2);
err = usb_get_string(dev, dev->string_langid, index, tbuf, 2); err = usb_get_string(dev, dev->string_langid, index, tbuf, 2);
} }
...@@ -1329,7 +1329,7 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size) ...@@ -1329,7 +1329,7 @@ int usb_string(struct usb_device *dev, int index, char *buf, size_t size)
len=tbuf[0]; len=tbuf[0];
err = usb_get_string(dev, dev->string_langid, index, tbuf, len); err = usb_get_string(dev, dev->string_langid, index, tbuf, len);
if (err == -EPIPE) { if (err == -EPIPE || err == 0) {
dev_dbg(&dev->dev, "RETRY string %d read/%d\n", index, len); dev_dbg(&dev->dev, "RETRY string %d read/%d\n", index, len);
err = usb_get_string(dev, dev->string_langid, index, tbuf, len); err = usb_get_string(dev, dev->string_langid, index, tbuf, len);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment