Skip to content

Commit

Permalink
zd1211rw: improve ejecting of fake CDROM
Browse files Browse the repository at this point in the history
The zd1211rw always assumed that the storage device is at endpoint 1,
but there are devices (Spairon Homelink 1202) that are at endpoint 0.
Try both, starting with 1 to make sure to not break existing setups.

Signed-off-by: Stefan Seyfried <seife@sphairon.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Stefan Seyfried authored and John W. Linville committed Dec 22, 2009
1 parent 5b6e2f1 commit 11466f1
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions drivers/net/wireless/zd1211rw/zd_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1078,11 +1078,15 @@ static int eject_installer(struct usb_interface *intf)
int r;

/* Find bulk out endpoint */
endpoint = &iface_desc->endpoint[1].desc;
if (usb_endpoint_dir_out(endpoint) &&
usb_endpoint_xfer_bulk(endpoint)) {
bulk_out_ep = endpoint->bEndpointAddress;
} else {
for (r = 1; r >= 0; r--) {
endpoint = &iface_desc->endpoint[r].desc;
if (usb_endpoint_dir_out(endpoint) &&
usb_endpoint_xfer_bulk(endpoint)) {
bulk_out_ep = endpoint->bEndpointAddress;
break;
}
}
if (r == -1) {
dev_err(&udev->dev,
"zd1211rw: Could not find bulk out endpoint\n");
return -ENODEV;
Expand Down

0 comments on commit 11466f1

Please sign in to comment.