From patchwork Tue Dec 8 14:21:35 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Seyfried X-Patchwork-Id: 65698 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nB8EN3KF010599 for ; Tue, 8 Dec 2009 14:23:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755548AbZLHOWF (ORCPT ); Tue, 8 Dec 2009 09:22:05 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755533AbZLHOWE (ORCPT ); Tue, 8 Dec 2009 09:22:04 -0500 Received: from mail-bw0-f227.google.com ([209.85.218.227]:62501 "EHLO mail-bw0-f227.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755310AbZLHOWB (ORCPT ); Tue, 8 Dec 2009 09:22:01 -0500 Received: by mail-bw0-f227.google.com with SMTP id 27so4392834bwz.21 for ; Tue, 08 Dec 2009 06:22:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=E/0v7HUc0Xt28g6RT27V2TI5Vz1m44BjZKamsAVS9Fg=; b=BfVcDKcwMguDaD8D5IgAIDY4v7BlbfeQQXHW3xXPNIGq+wF4zXa5MAz+B5GVZCEV8r 9hNTxPgZcNmJ0WW58NZqNYwkpBWau8A0E8pGdMr9Nj91ffQbZ0hdiyxWZkSY8z5FGSua GF22WQKEqzwYisD+/MviXTEpocuEtMhWPUAsU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=Ik4je0yqWCkOHxEV9OzQFxVl1FcVlb/7kjpPceRt7zyRhxdT5NlbbJZQxmEgbV4M1c fZmUWTGzokpKVHNfiZEAKO5W63pl6ekWDQXhvMMq3tvGncTotSHZ8tMwDfyONMdsmJJT XOtgtoaiHg1Kk2kIW6glA3VAbRqsajgIiHh7U= Received: by 10.204.7.88 with SMTP id c24mr8836665bkc.17.1260282127888; Tue, 08 Dec 2009 06:22:07 -0800 (PST) Received: from localhost.localdomain (p54B54C4D.dip.t-dialin.net [84.181.76.77]) by mx.google.com with ESMTPS id 16sm2367844fxm.0.2009.12.08.06.22.06 (version=SSLv3 cipher=RC4-MD5); Tue, 08 Dec 2009 06:22:07 -0800 (PST) From: Stefan Seyfried To: linux-wireless@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Stefan Seyfried Subject: [PATCH 2/2] zd1211rw: improve ejecting of fake CDROM Date: Tue, 8 Dec 2009 15:21:35 +0100 Message-Id: <1260282095-17042-3-git-send-email-stefan.seyfried@googlemail.com> X-Mailer: git-send-email 1.6.5.3 In-Reply-To: <1260282095-17042-2-git-send-email-stefan.seyfried@googlemail.com> References: <1260282095-17042-1-git-send-email-stefan.seyfried@googlemail.com> <1260282095-17042-2-git-send-email-stefan.seyfried@googlemail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index ac19ecd..4daf1c9 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) 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;