Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp848053ybv; Wed, 5 Feb 2020 15:54:23 -0800 (PST) X-Google-Smtp-Source: APXvYqw6IOmVpMiqqWdkrmQiZTNYtbrG69oO22umrblW/0aDFUmmCrZa90voV+23bY3zhkuckK6J X-Received: by 2002:aca:5083:: with SMTP id e125mr5050454oib.96.1580946863384; Wed, 05 Feb 2020 15:54:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580946863; cv=none; d=google.com; s=arc-20160816; b=GNBxgqzTzd6Hst/tNBjaaAnbcDjJmLfpSAqEoL3Qh3ZFaSN5EoDzOhPeS+xqvk661L gYXvdwEi6IO/Kx2N9o2fBkNPC8+lwxR3ujNwRvsHnpuH20I/26e9dDYdOuz4Sv3KqygB 6DMskFxKvdCYo4f1P8/LPhmrzA1cQUMpqepBruWVeE+713yyAW6NDaY6N2HYlXY9AEWP kHejQS+y+kdKy19EzoVIHssdVfaJs5q1HSM480GdpaILvYsfI3LIxuKmJJOCFEdISb1I vWSGrkPNpgHldb2w3/BloJrhE25RKeouoOQp/Gszav7vS1jTUgQJad2wBeJBChmE5cfj AWpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VSYheWMpImifSvRY4ArtPQSFKM2xPygUSD0KWPH5PB0=; b=LNyZZylb916v460/D5wTBD+pQV5rzNWqm0EVf9jG+FQjQGlRZfJfRpNsSKul+0g5HH 5Qo0zfmkwfLr7tWW69TCHEi376Lw5XVZdbrZTNmVIKyvyLMX4X31ou6fYJrA7bd8a0wG H3uXfbdKRdEyqupWs+iTT3ixc7gYQJstoOXy6AwEjtBe3gHN04mWnrKpBvvFMJsAvsR+ XJQJSvN8gRIaWnP3lHQdAzQkp4UcjDnuHPTbXpjv5xEt/RurxJtoH2VPgtHj/89+3jkE IKN+VDdO3lZGtEB5dyxOpHeszLZoi2vII3Pc1HXxl1Hok6/Rnso86WERD2Ivw7GYWem4 PUPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ASoSscm2; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x137si1116970oif.42.2020.02.05.15.54.08; Wed, 05 Feb 2020 15:54:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-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=@kernel.org header.s=default header.b=ASoSscm2; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727598AbgBEXx3 (ORCPT + 99 others); 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 Content-Transfer-Encoding: 8bit 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); -- 2.21.1