Commit b23eedd6 authored by Matthew Dharm's avatar Matthew Dharm Committed by Greg Kroah-Hartman

[PATCH] USB Storage: help vendors count to 1...

It turns out that the Konica-Minolta DiMAGE A2 camera, in addition to all
its other problems, returns a 0-length reply to the GetMaxLUN request.
With this patch (accept a null reply as meaning a single LUN) it is
somewhat useable.

It's amazing to me that vendors have this much trouble counting to 1....
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarMatthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 86f3555b
......@@ -911,6 +911,7 @@ int usb_stor_Bulk_max_lun(struct us_data *us)
int result;
/* issue the command */
us->iobuf[0] = 0;
result = usb_stor_control_msg(us, us->recv_ctrl_pipe,
US_BULK_GET_MAX_LUN,
USB_DIR_IN | USB_TYPE_CLASS |
......@@ -921,7 +922,7 @@ int usb_stor_Bulk_max_lun(struct us_data *us)
result, us->iobuf[0]);
/* if we have a successful request, return the result */
if (result == 1)
if (result >= 0)
return us->iobuf[0];
/*
......
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