Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp704680imm; Wed, 18 Jul 2018 09:14:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe+tW0/k28vPZmJchdmeF4WVwzB3Qm2HsU95d/eaH94FYIzKOI02w0se6Lw2i5BzsRapbi3 X-Received: by 2002:a63:b43:: with SMTP id a3-v6mr6329228pgl.50.1531930489518; Wed, 18 Jul 2018 09:14:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531930489; cv=none; d=google.com; s=arc-20160816; b=lzcMIFkYws2fJC6XpEEDFzL1HB77RgwMlkBXBJ2nzh+tLifMhuGVLGs33oVRLTmwj1 LHCR8fKr/V8SRnZJY8MzZN8Zgw4Q4AJVVpGExxV6rJ2QqpCaVW7b859nhxTSlEIE6ECd alC52Gp2P+pLQGEIPQ4t43cSGcireqfhKC34rI0Zva4jRft4b+bSJDcrrKktLkCDWS9t FTXA5C/mTYdjs7k3lXqB7RgHWjC/4gFou18ctw1CUEfYoeMWDFU88GYn++RyZwjKwjvZ fAqp/lHoCakkRvTO5B3kvgEIrb4uD1ywdsK0+U8+3fT8XH8XK2tuZ/TDBCmuHupS0i+4 Zv8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=5nw1HQAmv4GwhqMuUaC5yDqQkngaK0CYak4ZYQ4kb7k=; b=NpDpwdn72EFzqOlv8UmNzgSoS9YuiV4OGDwVwvIysTHnYnaHi6fkSM9NEDCAnfxO74 BLCJ8HgOTEY8EqamtX1dcyFzTz09vUCNalDG4of8Jfz1eFSp2mcCdtB7QGZZ6vcqljTz GzUvPpX9imsqcOKwKaZd+ndr5XxjLrKyPjUqCnTrUNqh6KZmG6NozNJtSSK3KOC8Ry3w YXLlkgQkFl5Y8OcjtYEbkgv0dC+rEw0EVAIi5CFlIr0643Uf27L42OBjlZ2Ns15CZ7XJ NnHo/4MXqGYnDnYRGJP+G9v0kf2icce7tf3W3zeUAppMWCy1F+GjZqcYqBZZCqHotxEY rnPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=kE9HkCU2; 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 k4-v6si3600727pfc.328.2018.07.18.09.14.34; Wed, 18 Jul 2018 09:14:49 -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; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=kE9HkCU2; 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 S1731821AbeGRQvK (ORCPT + 99 others); Wed, 18 Jul 2018 12:51:10 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:54615 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731535AbeGRQtV (ORCPT ); Wed, 18 Jul 2018 12:49:21 -0400 Received: by mail-wm0-f67.google.com with SMTP id c14-v6so3350375wmb.4 for ; Wed, 18 Jul 2018 09:10:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=5nw1HQAmv4GwhqMuUaC5yDqQkngaK0CYak4ZYQ4kb7k=; b=kE9HkCU2i2Zo9sm8D1hIwFs780xiRBBKt598nH9OeB0bbn1rSrfPXgsJ0zJkH/dVt0 pUsHG4sMy3Ye0vsLsKrhF6/z+kqqxIFhUpqIBkHqlEQQzJA6X7uilonoR2mQXqSBz4OO bdCbXliMU46bbir8A86dc/zMLupcV8EoCnmhXOQXKb4rGtC+2lml7B01mbwxMbQpyFTZ Gd+b3hu7Xht5SsmACFJHQ7kPkwTwrwSCAAev0SUNV357vD+faWt0c+TCzsjr38WlKqfP AdrBFOBxc2w/8q6PCT64q+tY/b/u3TLv34TFxLR75jXfeuEXPeXjNNA8koLu59Xn02oo bY2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5nw1HQAmv4GwhqMuUaC5yDqQkngaK0CYak4ZYQ4kb7k=; b=HxCXOp0Jr/Rt1ln8iZRFBv/dE11k7VcvvEp0DkoqcyAYqR58Bh1K1V/74ryCG1tx3l WF5kOtcUppS/F+s7ZvNawilERO/bLX9VUFfZ2NJqbU36i3SWJoTJWoLRMiFUcJidgwQt L/1n1GfZ3Ut4EhPzi6jFFHiFYPJwZ5sePv/bLxXJLdJ49aO6yH4qIeAowXO4O7024L+Z jCe0UULrD6wzpjfdvCqlebwWRd3HsHAF8cFRAQgWvZOgng6AUJfFk/l9gbQjJUlD6Xzt DLw+/7XjHuOHZ5oG6I3ZuKQJSMpFgJzfIUjCVjDmWIr6xWuhHPbHtIOUraRQ9NK/B38+ xHdQ== X-Gm-Message-State: AOUpUlFkFO4HZ/vCjSbLtT6B2wqSFuuuRdOm1MtKUBxxKCbiFvQ5ca3M 5DVguaiQZjn/osRt+BNmKjsdvQ== X-Received: by 2002:a1c:1802:: with SMTP id 2-v6mr1928894wmy.81.1531930244957; Wed, 18 Jul 2018 09:10:44 -0700 (PDT) Received: from brgl-bgdev.home ([2a01:cb1d:af:5b00:e837:b8d5:48c1:571b]) by smtp.gmail.com with ESMTPSA id v185-v6sm2847803wme.30.2018.07.18.09.10.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jul 2018 09:10:44 -0700 (PDT) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Russell King , Grygorii Strashko , "David S . Miller" , Srinivas Kandagatla , Lukas Wunner , Rob Herring , Florian Fainelli , Dan Carpenter , Ivan Khoronzhuk , David Lechner , Greg Kroah-Hartman , Andrew Lunn Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, netdev@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 2/5] net: add an info message to eth_platform_get_mac_address() Date: Wed, 18 Jul 2018 18:10:32 +0200 Message-Id: <20180718161035.7005-3-brgl@bgdev.pl> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180718161035.7005-1-brgl@bgdev.pl> References: <20180718161035.7005-1-brgl@bgdev.pl> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski Many drivers that read the MAC address from EEPROM or MTD emit a log message when they succeed. Since this function is meant to be reused in those drivers instead of reimplementing the same operation everywhere, add an info message when we successfully read the MAC address. Signed-off-by: Bartosz Golaszewski --- net/ethernet/eth.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c index da8530879e1e..2a2173324d9e 100644 --- a/net/ethernet/eth.c +++ b/net/ethernet/eth.c @@ -530,15 +530,24 @@ int eth_platform_get_mac_address(struct device *dev, u8 *mac_addr) struct device_node *dp = dev_is_pci(dev) ? pci_device_to_OF_node(to_pci_dev(dev)) : dev->of_node; const unsigned char *addr = NULL; + const char *from = NULL; - if (dp) + if (dp) { addr = of_get_mac_address(dp); - if (!addr) + if (addr) + from = "device tree"; + } + + if (!addr) { addr = arch_get_platform_mac_address(); + if (addr) + from = "arch callback"; + } if (!addr) return -ENODEV; + dev_info(dev, "read MAC address from %s\n", from); ether_addr_copy(mac_addr, addr); return 0; } -- 2.17.1