diff options
author | Stefan Seyfried <seife@sphairon.com> | 2009-12-08 09:21:35 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-12-22 13:56:05 -0500 |
commit | 11466f1342a3400dd5e03da3d8c45aa4149c62d4 (patch) | |
tree | c15b9b9c3ae4329493a02b350d22498f686fd258 /drivers/net/wireless/zd1211rw/zd_usb.c | |
parent | 5b6e2f12edd6c46e87a2775321f1912d19be4b35 (diff) |
zd1211rw: improve ejecting of fake CDROM
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>
Diffstat (limited to 'drivers/net/wireless/zd1211rw/zd_usb.c')
-rw-r--r-- | drivers/net/wireless/zd1211rw/zd_usb.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index ac19ecd19cfe..4daf1c94ec04 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c | |||
@@ -1078,11 +1078,15 @@ static int eject_installer(struct usb_interface *intf) | |||
1078 | int r; | 1078 | int r; |
1079 | 1079 | ||
1080 | /* Find bulk out endpoint */ | 1080 | /* Find bulk out endpoint */ |
1081 | endpoint = &iface_desc->endpoint[1].desc; | 1081 | for (r = 1; r >= 0; r--) { |
1082 | if (usb_endpoint_dir_out(endpoint) && | 1082 | endpoint = &iface_desc->endpoint[r].desc; |
1083 | usb_endpoint_xfer_bulk(endpoint)) { | 1083 | if (usb_endpoint_dir_out(endpoint) && |
1084 | bulk_out_ep = endpoint->bEndpointAddress; | 1084 | usb_endpoint_xfer_bulk(endpoint)) { |
1085 | } else { | 1085 | bulk_out_ep = endpoint->bEndpointAddress; |
1086 | break; | ||
1087 | } | ||
1088 | } | ||
1089 | if (r == -1) { | ||
1086 | dev_err(&udev->dev, | 1090 | dev_err(&udev->dev, |
1087 | "zd1211rw: Could not find bulk out endpoint\n"); | 1091 | "zd1211rw: Could not find bulk out endpoint\n"); |
1088 | return -ENODEV; | 1092 | return -ENODEV; |