From patchwork Wed Oct 13 19:14:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Drake X-Patchwork-Id: 251261 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9DJWbjN016831 for ; Wed, 13 Oct 2010 19:32:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752745Ab0JMTcd (ORCPT ); Wed, 13 Oct 2010 15:32:33 -0400 Received: from queueout04-winn.ispmail.ntl.com ([81.103.221.58]:31961 "EHLO queueout04-winn.ispmail.ntl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750976Ab0JMTcd (ORCPT ); Wed, 13 Oct 2010 15:32:33 -0400 Received: from aamtaout01-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout01-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20101013191459.JNLS3266.mtaout01-winn.ispmail.ntl.com@aamtaout01-winn.ispmail.ntl.com>; Wed, 13 Oct 2010 20:14:59 +0100 Received: from zog.reactivated.net ([86.14.215.141]) by aamtaout01-winn.ispmail.ntl.com (InterMail vG.3.00.04.00 201-2196-133-20080908) with ESMTP id <20101013191459.LWTO20122.aamtaout01-winn.ispmail.ntl.com@zog.reactivated.net>; Wed, 13 Oct 2010 20:14:59 +0100 Received: by zog.reactivated.net (Postfix, from userid 1000) id BA0A99D401B; Wed, 13 Oct 2010 20:14:56 +0100 (BST) From: Daniel Drake To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org Cc: libertas-dev@lists.infradead.org Cc: dcbw@redhat.com Cc: pgf@laptop.org Cc: steve@cozybit.com Subject: [PATCH] libertas: Communicate USB transfer errors Message-Id: <20101013191456.BA0A99D401B@zog.reactivated.net> Date: Wed, 13 Oct 2010 20:14:56 +0100 (BST) X-Cloudmark-Analysis: v=1.1 cv=4QByPj+6Iq2k/6L54d+eVKTdgQxdscpRskJJReCfdXo= c=1 sm=0 a=_YwKvoEXPowA:10 a=Op-mwl0xAAAA:8 a=aQS-Mb5gWoeAmrcn2zUA:9 a=s5tZD5HISwtoHLGML5UA:7 a=0Jzz1GfhQ9monLwgGbmgKWCuY8IA:4 a=d4CUUju0HPYA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 13 Oct 2010 19:32:38 +0000 (UTC) diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c index 3ff6106..16e2575 100644 --- a/drivers/net/wireless/libertas/if_usb.c +++ b/drivers/net/wireless/libertas/if_usb.c @@ -472,11 +472,12 @@ static int if_usb_reset_device(struct if_usb_card *cardp) */ static int usb_tx_block(struct if_usb_card *cardp, uint8_t *payload, uint16_t nb) { - int ret = -1; + int ret; /* check if device is removed */ if (cardp->surprise_removed) { lbs_deb_usbd(&cardp->udev->dev, "Device removed\n"); + ret = -ENODEV; goto tx_ret; } @@ -489,7 +490,6 @@ static int usb_tx_block(struct if_usb_card *cardp, uint8_t *payload, uint16_t nb if ((ret = usb_submit_urb(cardp->tx_urb, GFP_ATOMIC))) { lbs_deb_usbd(&cardp->udev->dev, "usb_submit_urb failed: %d\n", ret); - ret = -1; } else { lbs_deb_usb2(&cardp->udev->dev, "usb_submit_urb success\n"); ret = 0;