From patchwork Fri May 3 07:56:03 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: 10928025 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 5EE9F13AD for ; Fri, 3 May 2019 07:57:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53C80283BF for ; Fri, 3 May 2019 07:57:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 474DF283C8; Fri, 3 May 2019 07:57:41 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ECEDB283C5 for ; Fri, 3 May 2019 07:57:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727230AbfECH4v (ORCPT ); Fri, 3 May 2019 03:56:51 -0400 Received: from smtp-out.xnet.cz ([178.217.244.18]:44697 "EHLO smtp-out.xnet.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727224AbfECH4v (ORCPT ); Fri, 3 May 2019 03:56:51 -0400 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 45B843581; Fri, 3 May 2019 09:56:48 +0200 (CEST) Received: by meh.true.cz (OpenSMTPD) with ESMTP id 1de14fe6; Fri, 3 May 2019 09:56:46 +0200 (CEST) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: netdev@vger.kernel.org, devicetree@vger.kernel.org, Steve Glendinning , Microchip Linux Driver Support Cc: Andrew Lunn , Florian Fainelli , Heiner Kallweit , Frank Rowand , Srinivas Kandagatla , Maxime Ripard , =?utf-8?q?Petr_=C5=A0tetiar?= , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 06/10] net: usb: support of_get_mac_address new ERR_PTR error Date: Fri, 3 May 2019 09:56:03 +0200 Message-Id: <1556870168-26864-7-git-send-email-ynezz@true.cz> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1556870168-26864-1-git-send-email-ynezz@true.cz> References: <1556870168-26864-1-git-send-email-ynezz@true.cz> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There was NVMEM support added to of_get_mac_address, so it could now return NULL and 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 --- drivers/net/usb/smsc75xx.c | 2 +- drivers/net/usb/smsc95xx.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c index ec287c9..7acfa64 100644 --- a/drivers/net/usb/smsc75xx.c +++ b/drivers/net/usb/smsc75xx.c @@ -774,7 +774,7 @@ static void smsc75xx_init_mac_address(struct usbnet *dev) /* maybe the boot loader passed the MAC address in devicetree */ mac_addr = of_get_mac_address(dev->udev->dev.of_node); - if (mac_addr) { + if (!IS_ERR_OR_NULL(mac_addr)) { memcpy(dev->net->dev_addr, mac_addr, ETH_ALEN); return; } diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index e3d08626..841699f 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c @@ -917,7 +917,7 @@ static void smsc95xx_init_mac_address(struct usbnet *dev) /* maybe the boot loader passed the MAC address in devicetree */ mac_addr = of_get_mac_address(dev->udev->dev.of_node); - if (mac_addr) { + if (!IS_ERR_OR_NULL(mac_addr)) { memcpy(dev->net->dev_addr, mac_addr, ETH_ALEN); return; }