From patchwork Wed Feb 5 23:53:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 216514 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74B71C35247 for ; Wed, 5 Feb 2020 23:53:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 41598218AC for ; Wed, 5 Feb 2020 23:53:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580946810; bh=75pGg25zQlqJAGaOEaJDaAbAlapyhumudLnxCz7BDzE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=EHaso+IOzRzAZdiznlev7NxlelL5blX3ghKDh5rcOGqXNaOrtUj/6x7WfGhwyPV40 diJcepUlxgCG5Wh9OnwEz/tDNHWbihv8Rup3GJhBmqUw9qwWD3kw6Sw+IReO+VfQVe bQyT4bLiYOaRkJE2X8dPYbdbgh6eODZXkPmShh74= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727599AbgBEXx3 (ORCPT ); Wed, 5 Feb 2020 18:53:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:46208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727170AbgBEXx3 (ORCPT ); Wed, 5 Feb 2020 18:53:29 -0500 Received: from localhost.lan (unknown [151.48.147.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0F9AD20672; Wed, 5 Feb 2020 23:53:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580946809; bh=75pGg25zQlqJAGaOEaJDaAbAlapyhumudLnxCz7BDzE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ASoSscm2CzGxp1gTPdTm+ieQH1+LU4LuqG9rYaKcWYqs/yqsbp67cell/xY4UMCyu ckNJDiuVt/hfsB0sV97Sidwq/EVobgpwApYA2hkj3H1JeLMdgXmcQJj+LTGbLgki/d fnl4o7YXeLTd7FCKcpH11BKx2LZVnf4VAi/4sUX0= From: Lorenzo Bianconi To: nbd@nbd.name Cc: lorenzo.bianconi@redhat.com, linux-wireless@vger.kernel.org Subject: [PATCH 3/3] mt76: generalize mt76_mcu_get_response routine Date: Thu, 6 Feb 2020 00:53:10 +0100 Message-Id: <3b386467d4a0b160742a305a78f1ebeca760d365.1580945999.git.lorenzo@kernel.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Rely on mt76_mcu in mt76_mcu_get_response routine in order to reuse it in usb code Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mcu.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mcu.c b/drivers/net/wireless/mediatek/mt76/mcu.c index a2936f8de915..644f396a58a6 100644 --- a/drivers/net/wireless/mediatek/mt76/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mcu.c @@ -24,7 +24,6 @@ mt76_mcu_msg_alloc(const void *data, int head_len, } EXPORT_SYMBOL_GPL(mt76_mcu_msg_alloc); -/* mmio */ struct sk_buff *mt76_mcu_get_response(struct mt76_dev *dev, unsigned long expires) { @@ -34,11 +33,11 @@ struct sk_buff *mt76_mcu_get_response(struct mt76_dev *dev, return NULL; timeout = expires - jiffies; - wait_event_timeout(dev->mmio.mcu.wait, - (!skb_queue_empty(&dev->mmio.mcu.res_q) || + wait_event_timeout(dev->mcu.wait, + (!skb_queue_empty(&dev->mcu.res_q) || test_bit(MT76_MCU_RESET, &dev->phy.state)), timeout); - return skb_dequeue(&dev->mmio.mcu.res_q); + return skb_dequeue(&dev->mcu.res_q); } EXPORT_SYMBOL_GPL(mt76_mcu_get_response);