Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp590647yba; Sat, 4 May 2019 08:33:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxi+rmtqW3CC9PmpyQ1XCDJ0dTFkENY0gZNb6MFRdCTggX7wcHYtOGEsxazm52LfLvYM+47 X-Received: by 2002:a63:541d:: with SMTP id i29mr19088037pgb.174.1556984009447; Sat, 04 May 2019 08:33:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556984009; cv=none; d=google.com; s=arc-20160816; b=I//K8Mz73Xg9TK/CSkinLILUULrbYFhe5bShlcf2jSfJpNFh3qJ/THLy4Oh2QpbRX5 GpwnqhlpK4Z+eecW4QJWWEn5Sa3/Lr/V/HoEp7bvcc5ec1WFAq14glomIVYpuGHqP/tT 8MymJcQ4sjmDiV8JQlQ5s72ADRmV5HU/2VrYwQ4uBUOh/iYpBgDNbdA5NR6KSsIQnVVd D5fAE9mAGH8oTyTdXk0u/NNDlTstaLtoiBJmaiv4E6q5CWejBpxhN3E9e38m/yk1qUoz GbXwAxt8JWeten22bMj+r/ZsYVKJZrFzHrd1s+tzG8pHYT+oat0dOvU5J27MDRxyP/4W 4BTw== 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=IcHP1chbKHzmNgHIDF7d3p0HTXeqYqtjspxih3c2RTU=; b=uxLzdAjEH2EbEpBhJ6Xd7Dg2V0phIG9kD03mkpM0TwQZgfa6C0jO14djw6eUNkwcnk FeWrVdCaJR9hTnB5iV0rzYu3PNlHma0zxYgRP88o0EbORq85fvwMQuN5ANvMujVoK64D 8yB8Tz427ggYRdbYZSSe29uAmw0qEOFO2tFUk4T9//7FD6EaIF0ZvNunByTkFflvReSE T8PluyLKo5jMf3mlpJ8J/oDAjw330RfkBXW6glmSa8t1i9FvuPlrUu9+egV+qeKSrkeE Hh3co+2mtd46q0YlY5fXh8dBPrTd2VG3t1TAkUhLoKkp6qAeUIkvx0/L+pXOaoXWKjWO 4jFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=oIBqK90z; 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 d12si7790537pla.405.2019.05.04.08.33.15; Sat, 04 May 2019 08:33:29 -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=oIBqK90z; 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 S1727263AbfEDP34 (ORCPT + 99 others); Sat, 4 May 2019 11:29:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:49690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727259AbfEDP3z (ORCPT ); Sat, 4 May 2019 11:29:55 -0400 Received: from lore-desk-wlan.lan (unknown [151.66.59.15]) (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 BA4412086C; Sat, 4 May 2019 15:29:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556983794; bh=mo48v3iLxBWZ+hSXLiJXmH0RSKO8pC3YyybL8DbsTKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oIBqK90zH70DIpnip8Ekcd+pPFRWZTSWOd53t8IVh4kjmeuAt6GMYg78R/UGg9w/e 3dV0obgzn3/B+O8Z4YOYJKbBirUM3mmB7zk+FTSJn2lgGGb1j5pPGtaJhoH+lRet7C 4ZoMBQtAHyIDxNZTomgqY3QySfaN6g0CE+rTLTu0= 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: [PATCH 17/17] mt7615: mcu: run __mt76_mcu_send_msg in mt7615_mcu_send_firmware Date: Sat, 4 May 2019 17:29:09 +0200 Message-Id: <2966df64054c472bd8cf8453af5b2b5236f96adb.1556981521.git.lorenzo@kernel.org> 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 4fa41e2c5f77..5b01abe7aecf 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