From patchwork Fri May 3 14:27:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 10928865 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B4B9413AD for ; Fri, 3 May 2019 14:28:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3E59283C9 for ; Fri, 3 May 2019 14:28:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 973E12857F; Fri, 3 May 2019 14:28:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 44255283C9 for ; Fri, 3 May 2019 14:28:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RBMRBxR/aWQPywP124J9xrF9g3boVnhuRavQZHH6WzI=; b=PytsC+8XfFJMZo Ls+vJ2GRrVBKNXHSCcIX5XscIaIIlshjbql9K5zN115xyr/4o5q80UbubysVk/74eg1n4IacsYOEN r8gqg2qBNCB7TWxU3RcevsyrgNj/X5K21yy2BxwQr9tERyUoLcg+y52yJrJOoT/sPa0GYoWhHyGx4 km0KO9ckGLjNVJAMiVX2DvY4/5obulDbN4HgL2P9/QC2z6qPx5FHwkqTGve08evuI0vbDYbGr28PA 55ywBn9kii7xtYGgZmj1BgTBpXaEvLwzJzbVaV1topezfKILXfPIF2Y4o9jm/YFGnNMp90TABIu8H W7IN7w8gBEwlZkqGdzUQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hMZAM-0000ua-Jc; Fri, 03 May 2019 14:27:58 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hMZAD-0000h7-5o; Fri, 03 May 2019 14:27:53 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id 2BDF24AD4; Fri, 3 May 2019 16:27:47 +0200 (CEST) Received: by meh.true.cz (OpenSMTPD) with ESMTP id cbd31f28; Fri, 3 May 2019 16:27:45 +0200 (CEST) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: netdev@vger.kernel.org, devicetree@vger.kernel.org, QCA ath9k Development , Kalle Valo , "David S. Miller" , Felix Fietkau , Lorenzo Bianconi , Matthias Brugger , Stanislaw Gruszka , Helmut Schaa Subject: [PATCH v4 07/10] net: wireless: support of_get_mac_address new ERR_PTR error Date: Fri, 3 May 2019 16:27:12 +0200 Message-Id: <1556893635-18549-8-git-send-email-ynezz@true.cz> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556893635-18549-1-git-send-email-ynezz@true.cz> References: <1556893635-18549-1-git-send-email-ynezz@true.cz> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190503_072749_694922_E10D6627 X-CRM114-Status: GOOD ( 10.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Lunn , Florian Fainelli , Maxime Ripard , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla , linux-mediatek@lists.infradead.org, =?utf-8?q?Petr_=C5=A0tetiar?= , Frank Rowand , linux-arm-kernel@lists.infradead.org, Heiner Kallweit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP There was NVMEM support added to of_get_mac_address, so it could now return ERR_PTR encoded error values, so we need to adjust all current users of of_get_mac_address to this new fact. Signed-off-by: Petr Štetiar Acked-by: Kalle Valo --- Changes since v3: * IS_ERR_OR_NULL -> IS_ERR drivers/net/wireless/ath/ath9k/init.c | 2 +- drivers/net/wireless/mediatek/mt76/eeprom.c | 2 +- drivers/net/wireless/ralink/rt2x00/rt2x00dev.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index 98141b6..a04d861 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c @@ -642,7 +642,7 @@ static int ath9k_of_init(struct ath_softc *sc) } mac = of_get_mac_address(np); - if (mac) + if (!IS_ERR(mac)) ether_addr_copy(common->macaddr, mac); return 0; diff --git a/drivers/net/wireless/mediatek/mt76/eeprom.c b/drivers/net/wireless/mediatek/mt76/eeprom.c index a1529920d..0496493 100644 --- a/drivers/net/wireless/mediatek/mt76/eeprom.c +++ b/drivers/net/wireless/mediatek/mt76/eeprom.c @@ -94,7 +94,7 @@ return; mac = of_get_mac_address(np); - if (mac) + if (!IS_ERR(mac)) memcpy(dev->macaddr, mac, ETH_ALEN); #endif diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c index 357c094..19a794a 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c @@ -1007,7 +1007,7 @@ void rt2x00lib_set_mac_address(struct rt2x00_dev *rt2x00dev, u8 *eeprom_mac_addr const char *mac_addr; mac_addr = of_get_mac_address(rt2x00dev->dev->of_node); - if (mac_addr) + if (!IS_ERR(mac_addr)) ether_addr_copy(eeprom_mac_addr, mac_addr); if (!is_valid_ether_addr(eeprom_mac_addr)) {