Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 11466f13 authored by Stefan Seyfried's avatar Stefan Seyfried Committed by John W. Linville
Browse files

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: default avatarStefan Seyfried <seife@sphairon.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5b6e2f12
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -1078,11 +1078,15 @@ static int eject_installer(struct usb_interface *intf)
	int r;

	/* Find bulk out endpoint */
	endpoint = &iface_desc->endpoint[1].desc;
	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;
	} else {
			break;
		}
	}
	if (r == -1) {
		dev_err(&udev->dev,
			"zd1211rw: Could not find bulk out endpoint\n");
		return -ENODEV;