Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4087875yba; Sun, 19 May 2019 10:22:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0PzsDerDBcgkeeyuzZeiU87jTlM/+GWaiFE9v2mzo/W/LWwSn6lw4Afu08RKliaE+9fiL X-Received: by 2002:a17:902:728d:: with SMTP id d13mr28451477pll.337.1558286545829; Sun, 19 May 2019 10:22:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558286545; cv=none; d=google.com; s=arc-20160816; b=kRv4VMfZesrOJ0KAOiKGNWO45/tez1wdRZPLJ6xzeHqO0rmB+1lDtZxW/jHfUknQmt qlQ8vr4c8/ZNaSwWNgLyKsy4KKoGQ1/gwbMxi60Gyq//AIMUVWkAGoqlgVFw2EWClpNf xeTXdxJLv/DsMlcli6YNQODlMHoihreLba6BYbYacP5HIggIDIQqk7IBt3NUNgo70R7w vLXgRKJz3uwCdZ6GnXY4+Q09j8IJiU6v7VD1euYi4zaAkRNNP91Dev89WAjQazGNjwX7 4tNe3CiJV+hbwhUBx7MoP4PkcPT1cb8eiEwnbMgaJsiezP2c3uqJDz3QthegeN6FTn29 IwmQ== 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 :message-id:date:subject:cc:to:from; bh=HhoUCbHtkJmfvi1GG4gt+FL6znkqAPtndI+gRIx+PsQ=; b=GCI9q8orjJZgCTzwsRnrVvhPMl3JRSs+51Nq7pCeTpIqU98mqNNb9IRU50hKJiIqfx 3In2t2hXDKBse0+UovIzRnUBrqbocJJP5zmQmvUcxDbZTHZ56VhH9GaxdsOvG36+eV2j GuTgkXbbTB06DcqXHLQr9Ily8eBDRQgArNgAy8ebX7zIXgqxC6G8opM0oGGTLSXXyj83 ZnxahuNQV6Mr8gg5rFEnDMIJ3QX4s55K/ndcCfmAy73/SFN/Gb//oMBG27GQSpxAx3Me 2SxzDkS+fvu2906wF/ANbXN2vGtOTiUMJwM4xWngFnPcbEMchEUi8Ek6YVVc4u2xhngY Fa5w== 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 v13si15004148plo.429.2019.05.19.10.22.10; Sun, 19 May 2019 10:22:25 -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 S1726830AbfESRG2 (ORCPT + 99 others); Sun, 19 May 2019 13:06:28 -0400 Received: from smtp-out.xnet.cz ([178.217.244.18]:22240 "EHLO smtp-out.xnet.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725777AbfESRG2 (ORCPT ); Sun, 19 May 2019 13:06:28 -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 0E4444ACA; Sun, 19 May 2019 14:19:01 +0200 (CEST) Received: by meh.true.cz (OpenSMTPD) with ESMTP id d9c28ecb; Sun, 19 May 2019 14:18:59 +0200 (CEST) From: =?UTF-8?q?Petr=20=C5=A0tetiar?= To: Rob Herring , Frank Rowand , Andrew Lunn , Florian Fainelli , Heiner Kallweit Cc: =?UTF-8?q?Petr=20=C5=A0tetiar?= , Mirko Lindner , Stephen Hemminger , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] of_net: fix of_get_mac_address retval if compiled without CONFIG_OF Date: Sun, 19 May 2019 14:18:44 +0200 Message-Id: <1558268324-5596-1-git-send-email-ynezz@true.cz> X-Mailer: git-send-email 1.9.1 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 of_get_mac_address prior to commit d01f449c008a ("of_net: add NVMEM support to of_get_mac_address") could return only valid pointer or NULL, after this change it could return only valid pointer or ERR_PTR encoded error value, but I've forget to change the return value of of_get_mac_address in case where the kernel is compiled without CONFIG_OF, so I'm doing so now. Cc: Mirko Lindner Cc: Stephen Hemminger Fixes: d01f449c008a ("of_net: add NVMEM support to of_get_mac_address") Reported-by: Octavio Alvarez Signed-off-by: Petr Štetiar --- include/linux/of_net.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/of_net.h b/include/linux/of_net.h index 9cd72aab76fe..0f0346e6829c 100644 --- a/include/linux/of_net.h +++ b/include/linux/of_net.h @@ -22,7 +22,7 @@ static inline int of_get_phy_mode(struct device_node *np) static inline const void *of_get_mac_address(struct device_node *np) { - return NULL; + return ERR_PTR(-ENODEV); } static inline struct net_device *of_find_net_device_by_node(struct device_node *np) -- 1.9.1