Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp257757yba; Fri, 3 May 2019 00:59:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqw08xvfzCex2SGqthe7NMTrIlSCr8GVS8KBIpmPQgvmNt+wcjCxoXibvgUgkqdk8nAigr+k X-Received: by 2002:a65:4b88:: with SMTP id t8mr8593005pgq.374.1556870382750; Fri, 03 May 2019 00:59:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556870382; cv=none; d=google.com; s=arc-20160816; b=kmqrvB8To4RJhKHQ59LV1wdlQuSmzLTpXTmWZBTGpKIhjvWXOGL2lLaRI1eDcAM1C3 sPLfqzdIvRTWmwIQhVTkgT3ejg13SMcrsuQADdBwwoH8SHln2b0OCr4UMTZbWhB037A+ 1OVFcXSDMg357bL6bdTlXixNIhaIN+wF6fxtcY/Bp9VCi01c3eXlSWhTWSyCKeYiw/+Y XCWawUqPr3WJSGAXVeDoa2GSwCPJqVBi4DXKaf8Gx9OgDOxjlljH6aTEt2ByL9RaGv8w ZzwaU7HmsgXhHJlzvLT0Ee3olPdrNSw/izrBxJkui/ncCOU1WJ9tqzWRBeDJw9GLCtNh qIbA== 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; bh=QeNs0ZdDDv3miqCEDv08bz3YmT6fT3zqFihOmxARMl0=; b=qZaI5jA/iYkYzwnJTjyT7kNU2eyElh4gtFnpWDLldR35CA1lv0z6zRoB+VFjUSBL8F FPcuDGFsuIMird/+93FUXAdrHOHEkX7atpZuu5BOlavmskvI9eHmdl89xs7k52pfybjH swGKvkVRSEklOHYX/8Hg2W5nzDja1I6sDyBybhwJL1Xg5NiCYKJFUGvBwckhcHfaba2D utuJPpzj/woFI1fuazZn+/Z75s3A7dpDhfovz4GT6fPT1/9mhUjS/3I3LwY8Z7zOW03z dun8xRmS2HZdyEVye2JVAujjKgdAmwIXF0CTKkcs9FiDslLJUUkf/+x9NYSKdtfG8cgA LE+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n19si1340914pgh.457.2019.05.03.00.59.27; Fri, 03 May 2019 00:59:42 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727190AbfECH4l (ORCPT + 99 others); Fri, 3 May 2019 03:56:41 -0400 Received: from smtp-out.xnet.cz ([178.217.244.18]:44348 "EHLO smtp-out.xnet.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727166AbfECH4j (ORCPT ); Fri, 3 May 2019 03:56:39 -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 EB492357C; Fri, 3 May 2019 09:56:36 +0200 (CEST) Received: by meh.true.cz (OpenSMTPD) with ESMTP id bfb4ad22; Fri, 3 May 2019 09:56:35 +0200 (CEST) From: =?UTF-8?q?Petr=20=C5=A0tetiar?= To: netdev@vger.kernel.org, devicetree@vger.kernel.org, Nicolas Ferre Cc: Andrew Lunn , Florian Fainelli , Heiner Kallweit , Frank Rowand , Srinivas Kandagatla , Maxime Ripard , =?UTF-8?q?Petr=20=C5=A0tetiar?= , linux-kernel@vger.kernel.org Subject: [PATCH v3 03/10] net: macb: support of_get_mac_address new ERR_PTR error Date: Fri, 3 May 2019 09:56:00 +0200 Message-Id: <1556870168-26864-4-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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There was NVMEM support added directly to of_get_mac_address, and it uses nvmem_get_mac_address under the hood, so we can remove it. As of_get_mac_address can now return NULL and ERR_PTR encoded error values, adjust to that as well. Signed-off-by: Petr Štetiar --- Changes since v2: * ERR_PTR and EPROBE_DEFER handling drivers/net/ethernet/cadence/macb_main.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 3da2795..964911a 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4172,15 +4172,13 @@ static int macb_probe(struct platform_device *pdev) bp->rx_intr_mask |= MACB_BIT(RXUBR); mac = of_get_mac_address(np); - if (mac) { + if (PTR_ERR(mac) == -EPROBE_DEFER) { + err = -EPROBE_DEFER; + goto err_out_free_netdev; + } else if (!IS_ERR_OR_NULL(mac)) { ether_addr_copy(bp->dev->dev_addr, mac); } else { - err = nvmem_get_mac_address(&pdev->dev, bp->dev->dev_addr); - if (err) { - if (err == -EPROBE_DEFER) - goto err_out_free_netdev; - macb_get_hwaddr(bp); - } + macb_get_hwaddr(bp); } err = of_get_phy_mode(np); -- 1.9.1