From patchwork Sat Aug 25 10:40:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10576125 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2E83B14BD for ; Sat, 25 Aug 2018 10:42:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E4942AE6D for ; Sat, 25 Aug 2018 10:42:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12A5C2B009; Sat, 25 Aug 2018 10:42:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id BC1762AE6D for ; Sat, 25 Aug 2018 10:42:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=vcQv2N1ergvdsi0KKTk7mDbjX8uyElKKrzqRQyekanE=; b=CgI /ejqPwrAQ/Aw5ONhlUfKn1H1eJI1uDrehx+jft+g3xahO5qYoFStmvr2gaIM4tv/osqi6Zl+8XD/A 5cRZKO0L0vDVLTJb7yIPHZjAp7j9Mi1g/Sfa9lmDqEOLlYXxvkJQs9SXWVY1d+ufkMIGQlJOVde+t pjpC2LjtZ9bo2kxpd76KxAE5DvAzwknzezeMDZ4gu2c24sgiDl6deptBn9CevpWNfC8if4WbBVESp uxDjr1LHGSMPgv5OB1oCx+5REdmFbY5fjnUeou/WDMosHmEX6TzsqPMjP9VRsFU5D2LaPN/8D91Dd jN0YCwrEt3c7qNvFwA4j/AvYbdQYrEA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ftW1E-0005UQ-Ia for patchwork-linux-mediatek@patchwork.kernel.org; Sat, 25 Aug 2018 10:42:12 +0000 Received: from mail-wm0-f65.google.com ([74.125.82.65]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ftW0Z-0004zv-EM for linux-mediatek@lists.infradead.org; Sat, 25 Aug 2018 10:41:33 +0000 Received: by mail-wm0-f65.google.com with SMTP id s12-v6so3714284wmc.0 for ; Sat, 25 Aug 2018 03:41:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=SDrCLRfPcI/L2dFjrHn+u/w4Nn4yy5fTZgxHwn8V6i0=; b=rGf116GzOvljWkiFf8kYnSWyxpiKzSocnZAFzcnsm+MCt3KyO1AdZOqADl+vM/WrLM gMqVfySfuFzD70lYwBDKKywtsTcmeLW1ygNlV/cwk+83NDZdVNpJ6m3wI4fjQN2VW7ge ZpUCa5GKKGoulwW7t2ntsIVhbxhB6aYgujCjhG+zWVB/gU8Dp99VvBHJPlVEl1l4/u+w d3hH6Q7YXlS5xXkiVg5LHNXj4Spf23Pc7Z0HpJTHeONYYMv7kFd546xZ5nvBPOqVELIe E5b3o4o37Uhsb6v4GUxpkgzFuBjmjvs3zVZ4gsRsiCQeaaWhCzObyKSr6zf8jGORGKeo 79fw== X-Gm-Message-State: APzg51D0PV8ygWB7IYuSOxx5/4hWFo6Nx8MFtUtMZlN0TQgHS+YwCRWY xbX3sU0K+HAU7L+eVQM1V1YqCvMLiLM= X-Google-Smtp-Source: ANB0Vdbv2hC255Xm2Y0k7VRx6MolqB5i96gxUuqlX8JtEAxl9tVeJPjtcylXXdTnjd5g6i719v8mLg== X-Received: by 2002:a1c:3f45:: with SMTP id m66-v6mr862258wma.37.1535193679777; Sat, 25 Aug 2018 03:41:19 -0700 (PDT) Received: from localhost.localdomain ([151.66.53.29]) by smtp.gmail.com with ESMTPSA id l18-v6sm16391708wru.75.2018.08.25.03.41.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Aug 2018 03:41:19 -0700 (PDT) From: Lorenzo Bianconi To: nbd@nbd.name Subject: [PATCH 16/16] mt76x0: remove unused routines for usb_buff alloc/free Date: Sat, 25 Aug 2018 12:40:56 +0200 Message-Id: <20180825104056.9130-17-lorenzo.bianconi@redhat.com> X-Mailer: git-send-email 2.18.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180825_034131_525797_557692C3 X-CRM114-Status: UNSURE ( 8.66 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org, sgruszka@redhat.com MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Remove the following unused routines for usb buffer allocation/free/submit: - mt76x0_usb_alloc_buf - mt76x0_usb_free_buf - mt76x0_usb_submit_buf Signed-off-by: Lorenzo Bianconi --- .../net/wireless/mediatek/mt76/mt76x0/usb.c | 47 ------------------- .../net/wireless/mediatek/mt76/mt76x0/usb.h | 7 --- 2 files changed, 54 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c b/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c index e2b55d0d31da..4e71a13ff54c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/usb.c @@ -46,53 +46,6 @@ static struct usb_device_id mt76x0_device_table[] = { { 0, } }; -bool mt76x0_usb_alloc_buf(struct mt76x0_dev *dev, size_t len, - struct mt76x0_dma_buf *buf) -{ - struct usb_device *usb_dev = mt76x0_to_usb_dev(dev); - - buf->len = len; - buf->urb = usb_alloc_urb(0, GFP_KERNEL); - buf->buf = usb_alloc_coherent(usb_dev, buf->len, GFP_KERNEL, &buf->dma); - - return !buf->urb || !buf->buf; -} - -void mt76x0_usb_free_buf(struct mt76x0_dev *dev, struct mt76x0_dma_buf *buf) -{ - struct usb_device *usb_dev = mt76x0_to_usb_dev(dev); - - usb_free_coherent(usb_dev, buf->len, buf->buf, buf->dma); - usb_free_urb(buf->urb); -} - -int mt76x0_usb_submit_buf(struct mt76x0_dev *dev, int dir, int ep_idx, - struct mt76x0_dma_buf *buf, gfp_t gfp, - usb_complete_t complete_fn, void *context) -{ - struct usb_device *usb_dev = mt76x0_to_usb_dev(dev); - struct mt76_usb *usb = &dev->mt76.usb; - unsigned pipe; - int ret; - - if (dir == USB_DIR_IN) - pipe = usb_rcvbulkpipe(usb_dev, usb->in_ep[ep_idx]); - else - pipe = usb_sndbulkpipe(usb_dev, usb->out_ep[ep_idx]); - - usb_fill_bulk_urb(buf->urb, usb_dev, pipe, buf->buf, buf->len, - complete_fn, context); - buf->urb->transfer_dma = buf->dma; - buf->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; - - trace_mt76x0_submit_urb(&dev->mt76, buf->urb); - ret = usb_submit_urb(buf->urb, gfp); - if (ret) - dev_err(dev->mt76.dev, "Error: submit URB dir:%d ep:%d failed:%d\n", - dir, ep_idx, ret); - return ret; -} - void mt76x0_addr_wr(struct mt76x0_dev *dev, const u32 offset, const u8 *addr) { mt76_wr(dev, offset, get_unaligned_le32(addr)); diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/usb.h b/drivers/net/wireless/mediatek/mt76/mt76x0/usb.h index b4a5d98416ab..7bd075319f5b 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x0/usb.h +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/usb.h @@ -43,11 +43,4 @@ static inline bool mt76x0_urb_has_error(struct urb *urb) urb->status != -ESHUTDOWN; } -bool mt76x0_usb_alloc_buf(struct mt76x0_dev *dev, size_t len, - struct mt76x0_dma_buf *buf); -void mt76x0_usb_free_buf(struct mt76x0_dev *dev, struct mt76x0_dma_buf *buf); -int mt76x0_usb_submit_buf(struct mt76x0_dev *dev, int dir, int ep_idx, - struct mt76x0_dma_buf *buf, gfp_t gfp, - usb_complete_t complete_fn, void *context); - #endif