Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp6277141yba; Wed, 1 May 2019 09:09:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqwtFvnBhAgiM6fHm17lLYcitZVlCJBTq396X1JV4o8io0GX4U4Wz4wI/dDdAa7nGWVg0qfi X-Received: by 2002:a63:e003:: with SMTP id e3mr2239036pgh.0.1556726998519; Wed, 01 May 2019 09:09:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556726998; cv=none; d=google.com; s=arc-20160816; b=XjUW4ag65oIKSlgQp3TmRZinenmsOsZoAubbJfsNUS0SqfpPPDsJ97gXRuhIdBow0j DMLhtVCOeo/NoM+rhHemE/kB7QrBBQmD3/6nh+LzqXz7QF0c94RHz1wSpSL3PubWvI3g TbDn45pL0i927+4AY2HMvHNiYMVErYBEpxlOL6ce+LMg7CEsp2Yj3aHPBpcsz3xa0Ly1 YsAubGHqukC4MZzzayH+sw6cZGCx1RzI0GzLKZKk9mX3K6wFfivWzJqlCDiaOAZvierO dpj32vfYhA0zvPCbWmIxXZwys5YW5vMbkUv2JovupC7mCweqb7mXyotuG/DW5WmnjGVf Jovw== 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=0RuYeNpx7i7zIKNrunnRDr1Z5XpOJLwJQeMZpo89xJw=; b=OtL5hcaPgT55V2qJVbJZNphuumRHfS4G49ODyGtwjCuAQ/y1PB0vy6+1RSUsiwMDwO R7A7nRMkdid62QtSfieCiz4LEJc54GT19tLCcHuPtiK/OPJQba09y1/XAKQRKr1kUFXr ZYPllrmVXAkiS5H/v4o3K3EM4WpkvZwWxhJz9TmE0gJwau+AUbUufjswP7Izd3/SFkc+ tpOS6DutpUOP6CsJi3EMyKEkg0D2eet6lo3yb0Gpe9hax3t0tcOQkwdnduiLjIe+cttF x2lp/OL+p4y9QdXuRMHA5DCoBIIxyNEBzM07TT9cUlu8hg2sFLbeNIZl3Un1EBxWavkG 8Xcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lvDeUSjR; 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 n22si24188567pff.1.2019.05.01.09.09.43; Wed, 01 May 2019 09:09:58 -0700 (PDT) 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=lvDeUSjR; 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 S1726997AbfEAQIT (ORCPT + 99 others); Wed, 1 May 2019 12:08:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:37386 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726992AbfEAQIT (ORCPT ); Wed, 1 May 2019 12:08:19 -0400 Received: from localhost.localdomain (unknown [151.66.22.155]) (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 B917621783; Wed, 1 May 2019 16:08:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556726898; bh=ZjyVvbyfEtQKS0JqFClzRwfyHu+g+Q9sRNBsiGB22F0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lvDeUSjRZm3NlzY+d9PXe63ujDPpc7+DwO/VTAhv9waexyevPjcOUH+2jcGcale4F oVQ+K3qO6U3LjOgSCx5+gkdOIsm/Fi73tK7djPnaWEBtfzxO34ehVhHtloYJa/PstD ycIUyEqx17oS7G/WfjU+ycUeBapiJhgvfav9RRPo= From: Lorenzo Bianconi To: nbd@nbd.name Cc: lorenzo.bianconi@redhat.com, linux-wireless@vger.kernel.org, ryder.lee@mediatek.com, royluo@google.com Subject: [RFC 17/17] mt7615: mcu: run __mt76_mcu_send_msg in mt7615_mcu_send_firmware Date: Wed, 1 May 2019 18:07:39 +0200 Message-Id: X-Mailer: git-send-email 2.20.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 Run __mt76_mcu_send_msg instead of __mt7615_mcu_msg_send and remove duplicated code. Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index ec05bd805f42..6e4c294de2c4 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -179,19 +179,14 @@ static int mt7615_mcu_init_download(struct mt7615_dev *dev, u32 addr, static int mt7615_mcu_send_firmware(struct mt7615_dev *dev, const void *data, int len) { - struct sk_buff *skb; - int ret = 0; + int ret = 0, cur_len; while (len > 0) { - int cur_len = min_t(int, 4096 - sizeof(struct mt7615_mcu_txd), - len); - - skb = mt7615_mcu_msg_alloc(data, cur_len); - if (!skb) - return -ENOMEM; + cur_len = min_t(int, 4096 - sizeof(struct mt7615_mcu_txd), + len); - ret = __mt7615_mcu_msg_send(dev, skb, -MCU_CMD_FW_SCATTER, - NULL); + ret = __mt76_mcu_send_msg(&dev->mt76, -MCU_CMD_FW_SCATTER, + data, cur_len, false); if (ret) break; -- 2.20.1