Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9987963ybi; Wed, 24 Jul 2019 13:37:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqVUXeNnhD4eNOwYcTy60WlyaMUWBEt/ivqLzJHINEyWYSk73pvW0flY08WK6vTg7EzFQ+ X-Received: by 2002:a62:3895:: with SMTP id f143mr12911513pfa.116.1564000662798; Wed, 24 Jul 2019 13:37:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564000662; cv=none; d=google.com; s=arc-20160816; b=SYnTWeN/u6hcmJlKsbUc+sWDoGCka4ug/ZAWP9DOa9syW7q9Tc5OpB/4/Z7ERXmSuq XNE9lMprkNJSMWXOD4q7f6Xxp19HKvcYu6NLjESMF+NQjq8p2pFmm4Sty/TJvUjxvipj hr6gwU3/gJTFjhN+SbyJLwffAPO/CKsDmJsDgyisVMtYOSqbbED38X8rjIYK6J2YFRXH EN2GPnDhrltOxsLEoqSPMOQuL8aoR/56BeLVqcyKo9my6Wb13/Rc609Ro2Il2pq4FPBo aST10skbl1dp/W/XUbrcDFDU/Jyadl3JocSNsarhwJFYbafBx1idHmSOZ6p5J8kPVQlX svzA== 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=RBlUpwATKtK7IfDX7xXjcD3A22B9FXOjwakm01x2SVE=; b=uycbsyv1DssHS4UMRB0/fOuAmsl9HedhMyQIzhGdvMyQPl/pvNw2ivzuJQfcB0xzt5 DlKArA9JBwPYk6kDvk9HwxB5iz15D6QR+EKBb1HWVOW3PCmxT2oKHyCOaY81XP9PIeGU bSZBaX6vrJe9egJRHEHhLYMptB/lcabzMT+GivX0vtb361Ygw5UsrlCywQWahNPiDpFO /xekr1ka7uSSXVJ2+0+rb6SNv1bU3y2HC3DXuPJqPeOujMt2BKviC4I//3SWRV8YXop1 uO7KUA8eyhp046h/wjLaSAoJnP3nGqAlkX4IhZma2y14TI7c50i26jiSMH7eaoYd/yJF DJAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HOzNjfAZ; 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 l63si16367912pfl.41.2019.07.24.13.37.28; Wed, 24 Jul 2019 13:37: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; dkim=pass header.i=@kernel.org header.s=default header.b=HOzNjfAZ; 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 S2390022AbfGXUfG (ORCPT + 99 others); Wed, 24 Jul 2019 16:35:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:43190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387576AbfGXT0O (ORCPT ); Wed, 24 Jul 2019 15:26:14 -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 860FF2238C; Wed, 24 Jul 2019 19:26:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996373; bh=D1ImSPYYb7rvJrA9L8FdYS8eG3GasbQG6P3ud3fBYWA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HOzNjfAZzvfKJ18YBj5EAcyOXXxCWPLsMw7TueBRXCV9GMzOczSS5WCWZOK3Yfz32 0HR9kb/lqUH9tzH7GI0WyPuOuUap5faBl6/6tcFnpLQFXHH73s0AJRDMLGRRKPPZOn ru3sKXoo9BnuUGzR6Yd5proRK+9eK0DFO6pHp9Gw= 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 5.2 072/413] net: fec: Do not use netdev messages too early Date: Wed, 24 Jul 2019 21:16:03 +0200 Message-Id: <20190724191740.257055985@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@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 38f10f7dcbc3..831bb709e783 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -1689,10 +1689,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