From patchwork Fri Jan 27 08:34:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Fietkau X-Patchwork-Id: 9540685 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.web.codeaurora.org (Postfix) with ESMTP id 7F38F60429 for ; Fri, 27 Jan 2017 08:36:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7522F26E75 for ; Fri, 27 Jan 2017 08:36:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6866826E91; Fri, 27 Jan 2017 08:36: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.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 9228627FBB for ; Fri, 27 Jan 2017 08:36:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754388AbdA0Iek (ORCPT ); Fri, 27 Jan 2017 03:34:40 -0500 Received: from nbd.name ([46.4.11.11]:38196 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754297AbdA0Iei (ORCPT ); Fri, 27 Jan 2017 03:34:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Message-Id:Date:Subject:Cc:To:From; bh=+oWnZMQLbFEgQDM/Aknfk7JGVI7wpKWEGHUsC0Rr5wM=; b=LPeQCTlebkz1xdCSYKLZ3GhjAUSIahjOgVX+GDZulQVgm31bwVla0V67EoOPvIhzVAgpvl5gcO9yXhdDGqzmySULJVbBKaBUZMJVypp5cvxjCS/ThtYqVBafLh2Req7zejc2lXAXZh8Lb8/KXMlUWgbggxU1TmZW2LjmM4mWUCo=; Received: by nf-4.local (Postfix, from userid 501) id 2706018930570; Fri, 27 Jan 2017 09:34:26 +0100 (CET) From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: kvalo@codeaurora.org, sgruszka@redhat.com, vishalthanki@gmail.com Subject: [PATCH] rt2x00: avoid introducing a USB dependency in the rt2x00lib module Date: Fri, 27 Jan 2017 09:34:26 +0100 Message-Id: <20170127083426.22655-1-nbd@nbd.name> X-Mailer: git-send-email 2.11.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 Though protected by an ifdef, introducing an usb symbol dependency in the rt2x00lib module is a major inconvenience for distributions that package kernel modules split into individual packages. Get rid of this unnecessary dependency by calling the usb related function from a more suitable place Fixes: 8b4c0009313f ("rt2x00usb: Use usb anchor to manage URB") Signed-off-by: Felix Fietkau --- drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 3 --- drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c index 8fcbc8dc94c1..75f838405344 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c @@ -1436,14 +1436,11 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev) cancel_work_sync(&rt2x00dev->intf_work); cancel_delayed_work_sync(&rt2x00dev->autowakeup_work); cancel_work_sync(&rt2x00dev->sleep_work); -#if IS_ENABLED(CONFIG_RT2X00_LIB_USB) if (rt2x00_is_usb(rt2x00dev)) { - usb_kill_anchored_urbs(rt2x00dev->anchor); hrtimer_cancel(&rt2x00dev->txstatus_timer); cancel_work_sync(&rt2x00dev->rxdone_work); cancel_work_sync(&rt2x00dev->txdone_work); } -#endif if (rt2x00dev->workqueue) destroy_workqueue(rt2x00dev->workqueue); diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c index 838ca58d2dd6..be5beaacf4f0 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c @@ -858,11 +858,13 @@ void rt2x00usb_disconnect(struct usb_interface *usb_intf) { struct ieee80211_hw *hw = usb_get_intfdata(usb_intf); struct rt2x00_dev *rt2x00dev = hw->priv; + struct usb_anchor *anchor = rt2x00dev->anchor; /* * Free all allocated data. */ rt2x00lib_remove_dev(rt2x00dev); + usb_kill_anchored_urbs(anchor); rt2x00usb_free_reg(rt2x00dev); ieee80211_free_hw(hw);