Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3821992ybi; Mon, 29 Jul 2019 13:17:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxovG42BS6YaE+saf/msjuYQ0LyvSJURiLSuRruk6N+Daq3rY9Cyd14AKSl1M9j9rMPvK8W X-Received: by 2002:a65:584f:: with SMTP id s15mr89057204pgr.175.1564431464095; Mon, 29 Jul 2019 13:17:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564431464; cv=none; d=google.com; s=arc-20160816; b=z14j7Ymxcu9CvGubJ6fjUoegtqWV+M045y7Kup93srua9AGiAOhRXQAYwyR+/oatRu 5Hg8XQJUV0G2jZBWhAPx5QyOFPo9o3/zX7fdsgoLKkTRmH566EA+mtBufWOut1kaMbA4 hPHas60Nggo3Fftqz3Wclu9dYxvGW2VEOu7Z2OljhCRkxczjop8YCfNdRn2H4bQ3ISVb J2fhBy/PVPkzUkUnHQRkWdV1Jp5ek7KuE3euWsdazYs6vxx5xjczYGjknlavLv8mfV54 jcE1hEdS7nCoaR0zs7isZrU3/gS/eTpRfU/Y0g3ZiJMfKyUDcbEXJR2HHTuwxtdRByET GmoA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zM+twuuLtGXiJ/Z51oQDHgnQM3R9pRHhuKmznqay49o=; b=MEqfOPiifb5kvJYvl5irEMUXwgSm+QNipbXvvl/cbunuzjTKrjLQq/S5H9XFiGXyVi hgAJpjWdpfGg1OsNaWPnf1ot38RAxIv9ZHaTkbPLUnQThSZ4OV8OxegDty90uR/RYK6O v1HQcqfN71E4xGn6qGhtW/fw61jm+bRISjjHZQy8N56Ic4HygjHPaXi7t58x2LO6Nvqe w6dqZTQrsot8XEo/DQGXEeJ197wW+c1uPYceI/a6VKrIH38OO8rgUdonQ7MQkAcAtcFB sBEr/i80Y19O5wb5KWXGCVoHTgNaTokTvoTKRvSsLJ3aBTmZcbMR8ychZppip9n/qX/2 n75w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CnDya9yH; 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 28si6053931pgp.22.2019.07.29.13.17.28; Mon, 29 Jul 2019 13:17:44 -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=@kernel.org header.s=default header.b=CnDya9yH; 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 S1729626AbfG2TZL (ORCPT + 99 others); Mon, 29 Jul 2019 15:25:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:37418 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729616AbfG2TZJ (ORCPT ); Mon, 29 Jul 2019 15:25:09 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 52C6320C01; Mon, 29 Jul 2019 19:25:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428307; bh=DALpkklFHO6E9SF+PrUi0dQoY30baGbx7V7159esCZo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CnDya9yHaLklWXAUpSrG0rUaleJD1Sh8ONthBY9idbHTljvA2UEJv7qe3wM35qRI9 HC/PhHIOJSaEEBGrDCWTEhtodHiuf3Sz4dHBDhE4YATrP2Ji6HSn8/XAtP9MRcnYpL wSq+Eol2q1BaXIcpI+L2Irx+C9RPxMDR5gnGq0x4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fabio Estevam , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 035/293] net: fec: Do not use netdev messages too early Date: Mon, 29 Jul 2019 21:18:46 +0200 Message-Id: <20190729190824.884236330@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@linuxfoundation.org> User-Agent: quilt/0.66 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 [ Upstream commit a19a0582363b9a5f8ba812f34f1b8df394898780 ] When a valid MAC address is not found the current messages are shown: fec 2188000.ethernet (unnamed net_device) (uninitialized): Invalid MAC address: 00:00:00:00:00:00 fec 2188000.ethernet (unnamed net_device) (uninitialized): Using random MAC address: aa:9f:25:eb:7e:aa Since the network device has not been registered at this point, it is better to use dev_err()/dev_info() instead, which will provide cleaner log messages like these: fec 2188000.ethernet: Invalid MAC address: 00:00:00:00:00:00 fec 2188000.ethernet: Using random MAC address: aa:9f:25:eb:7e:aa Tested on a imx6dl-pico-pi board. Signed-off-by: Fabio Estevam Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/freescale/fec_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 98cd53d380f7..0ae6532b02e0 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1690,10 +1690,10 @@ static void fec_get_mac(struct net_device *ndev) */ if (!is_valid_ether_addr(iap)) { /* Report it and use a random ethernet address instead */ - netdev_err(ndev, "Invalid MAC address: %pM\n", iap); + dev_err(&fep->pdev->dev, "Invalid MAC address: %pM\n", iap); eth_hw_addr_random(ndev); - netdev_info(ndev, "Using random MAC address: %pM\n", - ndev->dev_addr); + dev_info(&fep->pdev->dev, "Using random MAC address: %pM\n", + ndev->dev_addr); return; } -- 2.20.1