From patchwork Tue Apr 4 06:18:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 96695 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp48415qgd; Mon, 3 Apr 2017 23:18:52 -0700 (PDT) X-Received: by 10.98.156.203 with SMTP id u72mr21487122pfk.127.1491286732010; Mon, 03 Apr 2017 23:18:52 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si746909pgf.57.2017.04.03.23.18.51; Mon, 03 Apr 2017 23:18:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752556AbdDDGSv (ORCPT + 6 others); Tue, 4 Apr 2017 02:18:51 -0400 Received: from mail-pg0-f51.google.com ([74.125.83.51]:34045 "EHLO mail-pg0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751092AbdDDGSu (ORCPT ); Tue, 4 Apr 2017 02:18:50 -0400 Received: by mail-pg0-f51.google.com with SMTP id 21so142776975pgg.1 for ; Mon, 03 Apr 2017 23:18:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iuPu4lRlMjUFwZ+IXyUm+27S2ChXPG77SFpGXF94I7c=; b=TooHTPT+Jj/K33Ku7ZWPyvZaqTObQLDtIPx6R4e7tmHCBA0SKyD4hrIRP6o/VgOw2l o/VcbR3UmOp+j9dl0xQmwfLJT4Zmjdr9k00UXEHYy10dzuiwVnbZYOrMGTYXzzqrM6j9 7CzuXk2ietAKvrsxpcozvBFm/rAGDREN+GUA8= 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:in-reply-to :references; bh=iuPu4lRlMjUFwZ+IXyUm+27S2ChXPG77SFpGXF94I7c=; b=CHsipMMUDNkV9lVs+2QUJBqsoe8ACf5Axrskl7NY+1+6TZ8+h5Vx/INj1yMR5OlI99 nevcQx0warIjhsYgsrsNbs/LGkKmO8nwpr0lnJx3IO9MoK25wN7i3a8TCG7wslEK5df4 VRcCJjPbQnvvVsJWVNodS6fdL4tdJr1/hDqwX35gmFEpevFcUHmS87aCDkccBPZXmGcl KIlSnA8JP8vooL2Ejt35z2yT+h5khzbcvB3NXRoW46eqElYbDIRu01ElLfy6K1/WFQSO 6blk8rNf6KFMfLVKmOTRwPuEy7yas1HytRELGU8rC7RD5s4UhP97SC31Y7mNrnhzvb1a VyZA== X-Gm-Message-State: AFeK/H2YZkEnrATLVsDZcVJ9/hvpGRzgw/SCProb+cCyJx5oNVk8ki0VRQYFe7QCBqLosy51 X-Received: by 10.98.0.66 with SMTP id 63mr20799561pfa.145.1491286730067; Mon, 03 Apr 2017 23:18:50 -0700 (PDT) Received: from localhost.localdomain ([106.51.240.246]) by smtp.gmail.com with ESMTPSA id y70sm29190878pfa.96.2017.04.03.23.18.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 03 Apr 2017 23:18:49 -0700 (PDT) From: Amit Pundir To: gregkh@linuxfoundation.org Cc: stable@vger.kernel.org, Stanislaw Gruszka , Vishal Thanki , Kalle Valo Subject: [PATCH 33/33] rt2x00: avoid introducing a USB dependency in the rt2x00lib module Date: Tue, 4 Apr 2017 11:48:39 +0530 Message-Id: <1491286719-31388-4-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491286719-31388-1-git-send-email-amit.pundir@linaro.org> References: <1491286719-31388-1-git-send-email-amit.pundir@linaro.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Stanislaw Gruszka As reported by Felix: 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. Cc: Vishal Thanki Reported-by: Felix Fietkau Fixes: 8b4c0009313f ("rt2x00usb: Use usb anchor to manage URB") Signed-off-by: Stanislaw Gruszka Signed-off-by: Kalle Valo (cherry picked from commit 6232c17438ed01f43665197db5a98a4a4f77ef47) Signed-off-by: Amit Pundir --- drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 23 ++++++++--------------- drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | 5 +++++ 2 files changed, 13 insertions(+), 15 deletions(-) -- 2.7.4 diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c index b7273be..c8d9075 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c @@ -1422,21 +1422,6 @@ 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); - - /* - * Free the tx status fifo. - */ - kfifo_free(&rt2x00dev->txstatus_fifo); /* * Kill the tx status tasklet. @@ -1452,6 +1437,14 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev) */ rt2x00lib_uninitialize(rt2x00dev); + if (rt2x00dev->workqueue) + destroy_workqueue(rt2x00dev->workqueue); + + /* + * Free the tx status fifo. + */ + kfifo_free(&rt2x00dev->txstatus_fifo); + /* * Free extra components */ diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c index 662705e..631df69 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c @@ -740,6 +740,11 @@ void rt2x00usb_uninitialize(struct rt2x00_dev *rt2x00dev) { struct data_queue *queue; + usb_kill_anchored_urbs(rt2x00dev->anchor); + hrtimer_cancel(&rt2x00dev->txstatus_timer); + cancel_work_sync(&rt2x00dev->rxdone_work); + cancel_work_sync(&rt2x00dev->txdone_work); + queue_for_each(rt2x00dev, queue) rt2x00usb_free_entries(queue); }