From patchwork Mon Jun 26 08:01:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Pundir X-Patchwork-Id: 106312 Delivered-To: patch@linaro.org Received: by 10.140.101.48 with SMTP id t45csp103163qge; Mon, 26 Jun 2017 01:01:48 -0700 (PDT) X-Received: by 10.99.100.5 with SMTP id y5mr13131229pgb.92.1498464107942; Mon, 26 Jun 2017 01:01:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498464107; cv=none; d=google.com; s=arc-20160816; b=LSNFsOHa3pVqY4acrJth5k8I8VQMods4cFJx6fesEamPXXxzJEbYPiZbx3b/vq8Frd sxY8JH3eBCK5r1Rup35ky2fCPT7NWwkawmbwr/WbkZKcbeQ93VGRwEVAUqhhYHAG1RGV zaKbfYJLOgMHUHAw2B20XVm070K50v8IU9Y15BbtyvSmVY9WLl4+lMNs3Fddkfhl2ctZ tOCbqMlMZcxQG01ghfuROphitr5SV54jed5/EOuBu+M+hvkb3Mj4SbwpMUhP6iCR4PZ2 /zSomIiLnMK+eqO2j0AxAhElpxJ2CGQx8HvEEqgyzshVhTzYdyg2QbdHZGNCeJkefOxu rNjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=F5AEzZiMUWOn7ZjU+PY2jqvVarSj7C65kOY4QdfBaa8=; b=pXHQB2Lgyuxau3GevSfMg6N2ZALzEdzoCYqeubjlpFs0xS5DjLvSp/+vaEqVqAo+/J zh4bQ/y4GgCTdlMZftyTtbnLQbizxDWofCjfG+S4sBX0GAiy3+Y/UplWw1kiEq5suYIN alPGS10ZBrlTYy9iz4TtPPIn7A6//mp3YHLqehLhTieeUEnTLxhviMzxiE0+jBiXp4is Z8KuAfZgQrTcoorXM3kDI9L3lraBrjjHGi6/uRowGu1UQ+Kdmgk/hCMwtuaBt1z1Xt9w AZDEMBH5cjBn2syQoLPxObYBVebUYROxYTEfDC/P63c4cKz09xPue7HEY7gGjKqlT5id gevQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.b=N5+1d9Fj; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 102si8959663pld.125.2017.06.26.01.01.47; Mon, 26 Jun 2017 01:01:47 -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 header.b=N5+1d9Fj; 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 S1751389AbdFZIBr (ORCPT + 6 others); Mon, 26 Jun 2017 04:01:47 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:35725 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751353AbdFZIBq (ORCPT ); Mon, 26 Jun 2017 04:01:46 -0400 Received: by mail-pf0-f182.google.com with SMTP id c73so51415207pfk.2 for ; Mon, 26 Jun 2017 01:01:46 -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=F5AEzZiMUWOn7ZjU+PY2jqvVarSj7C65kOY4QdfBaa8=; b=N5+1d9FjiBhkL580ngH2cckkHAzn+UbNvZKKYpC1Fd4kwm50f1P5Xed/3onlrCJXaS AQC1+et4DwbDp+yJECl+s4ZfBX5lc+sByJ6XenBveiVQxIKZjVhMe15ZugGeJgu63lm3 togTGhbzuHNEtoHTAb+y0fXxx6SL0/VZwAz8E= 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=F5AEzZiMUWOn7ZjU+PY2jqvVarSj7C65kOY4QdfBaa8=; b=GwU2wPer5pAv4XMpv3O74P1FCx3+i+BYB46cMg+75zx5GkxpFW1aNAOzD1uUUecIXw KNCA5uKhrmqdXIhYt5j/3C2bKbzqt76yfFmVNYS+u8NIU0wdPZCQH9dxurJYYkxYIj6T fqOPFXw02beCSLcpGbifFlhOrzQrjYUEzpA+2Ds+7EuGHg0xsYBzBq+4GQ73thPOBlOF RHtPTyu39wThK9MuxXQM85vmNsGxkChyP+odMZqde16+NdoDN2PqcLUx21dr9JRjH9Uk UI8zIMUv9NfUpyD6MUcrxxyjYfY4b7njYBSAUmMyg7CW8oPlZ7caHXxfXHEFboNNaBZU kaDw== X-Gm-Message-State: AKS2vOyXKTRV2SEkwr6xqzGL1to5zxg29PvElH1biYP9uH+jnZrLqhHB HvKLF3DqzuEPca/8 X-Received: by 10.84.208.236 with SMTP id c41mr21809957plj.95.1498464105676; Mon, 26 Jun 2017 01:01:45 -0700 (PDT) Received: from localhost.localdomain ([106.51.139.251]) by smtp.gmail.com with ESMTPSA id 67sm23673640pfa.83.2017.06.26.01.01.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 26 Jun 2017 01:01:44 -0700 (PDT) From: Amit Pundir To: Greg KH Cc: Stable , Stanislaw Gruszka , Vishal Thanki , Kalle Valo Subject: [PATCH for-4.9 3/7] rt2x00: avoid introducing a USB dependency in the rt2x00lib module Date: Mon, 26 Jun 2017 13:31:27 +0530 Message-Id: <1498464091-26753-4-git-send-email-amit.pundir@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1498464091-26753-1-git-send-email-amit.pundir@linaro.org> References: <1498464091-26753-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 commit 6232c17438ed01f43665197db5a98a4a4f77ef47 upstream. 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 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 b7273be9303d..c8d9075339cf 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 662705e31136..631df690adbe 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); }