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: 10576093 X-Patchwork-Delegate: kvalo@adurom.com 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 8172C109C for ; Sat, 25 Aug 2018 10:41:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 714AD2AE30 for ; Sat, 25 Aug 2018 10:41:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 65A3B2AEE7; Sat, 25 Aug 2018 10:41:23 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 098F42AFC2 for ; Sat, 25 Aug 2018 10:41:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727144AbeHYOTz (ORCPT ); Sat, 25 Aug 2018 10:19:55 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35384 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727113AbeHYOTz (ORCPT ); Sat, 25 Aug 2018 10:19:55 -0400 Received: by mail-wm0-f66.google.com with SMTP id o18-v6so3864788wmc.0 for ; Sat, 25 Aug 2018 03:41:20 -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=uLa1dlcUDsJlw6sxL6TBOZCfK96A+Zvjs9gMYLAjHMZWRIPRM4h6dc9cy8BQpsj1nh XdHNSXXFqQEVvwUA046H551HbopQLWaoBq+bFX6OHmbsvdRiMou2ZTyBgtBUBl5qbS6O qMUGfX4g+Yd+8r3mcADeuKdu5ab8joB/IbarZvh1s7ZdLLjiCEv5ps9VpKOXiwPfxiGs CUKkSSzXM4c0Zp+ZSER/BdTeosYzZ0h4uX17GZhO5iDG5YQdONtRkGATWRcXCFzYxMZ8 2ScrOmpZud2OgWV50Q29HMDRlRYqT7UtQrrl4V2vzHn5tCGU5ndDhPkOtdB3kwM4veZ7 ml2g== X-Gm-Message-State: APzg51BsnA55uEFloxL3loJ3/9h6CaD21ODH+mnpLgaJAdir1duHKyXc THzjIGf0/E8pT+YQ20jrCnEgQQ== 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 Cc: sgruszka@redhat.com, linux-wireless@vger.kernel.org, linux-mediatek@lists.infradead.org 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 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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