Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10408234ybi; Wed, 24 Jul 2019 22:40:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNFQi+cB8vHoOgXMkFb1VQ9EVyvKjMQ7pber9ujWr6jbKk25DCi74hguCvzVbrP1jwTKYJ X-Received: by 2002:a62:ae02:: with SMTP id q2mr14529450pff.1.1564033252859; Wed, 24 Jul 2019 22:40:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564033252; cv=none; d=google.com; s=arc-20160816; b=0kqaPdLcCC6keWEuyrexGBZLSR6Ft2cGPu7vgVE/90HFU4MEWg4JRW+MHM9sumohtE JqM3E5nIlyLK5RXpg6FV9gL5M901P6PWbhAc+Rhiqtp758KXRkXleZYLnwXAmy26Z1TG W4nyE0GFDBOidjaEJBawyPXu+BtQijYGKzDwbLCF5/4DdmQvEsUbhXfYE2bhJ0s7O3Jv Xi0fuY6CCOqs95FGkhNNTcFxzd1u3/q2HKtYIbxAmasLQq83O0u8sv5Nh2tEhGGDpXe2 k8ZCDY2I9mBggC0q6VRyYONBjDRd3hzjEJgzxllAVpdErLCa6GiZpXgSIg1I9d9hwuZD 09kA== 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=XxmV2sPVCI/IABs6QEo6uIVrV7k7vy0uqhuk8ulzYbA=; b=CNQpilJLU+7gnspoHdFrihvUPqsZihFtuprdXwwo2k/OEJpwpdnAISvdATHwmFJ0P+ DwIUNMVJNw5mtCM3NcWLuiEuJIDmqaCf8WvvZxzBFZ9XhErH2h4f6h8NAu2Uc5JYzan8 zWdimLY9Q1n5cXWflxlrsMAL2AXoPjNkOuyXK878uBXHGJbVHfw+c3+xZNSv3hmqtK5P tEdDYL+pibPrne2nEsnRrIssTb9EswhPMtr263NeP0cq3hVYBb09G9AfLyEWAQ9NRob+ yxeFQD1ocZk+z94MSkYFmJ2nRn5dFin5wfomMPO9QolWfcGfpRljnper5h9A44dBwLSg R4eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Ron5FtvY; 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 v8si17143062pfm.83.2019.07.24.22.40.38; Wed, 24 Jul 2019 22:40:52 -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=Ron5FtvY; 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 S2405683AbfGXUDQ (ORCPT + 99 others); Wed, 24 Jul 2019 16:03:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:53510 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405671AbfGXUDO (ORCPT ); Wed, 24 Jul 2019 16:03: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 4015421855; Wed, 24 Jul 2019 20:03:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563998593; bh=CUFy3C9Z/A2fczkvATMxwxsaOE2qdkjLu551AQQj3pw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ron5FtvYL8zSCRxY1E5VKwaX4r2CFCD/VhqGoj6fa3EFLMDJhoIUfRmSMEh1VYgsf sdjLZKLRYcUfjkbLrcj2QE8MmZfYigbY9EXGS/7Mo6GIP8jqurWq+RQU8ZtD35dRaI qh4a9cT0C/jYmAFNKMesYhGZoEKRFvYIeNJTq848= 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.19 048/271] net: fec: Do not use netdev messages too early Date: Wed, 24 Jul 2019 21:18:37 +0200 Message-Id: <20190724191659.279669709@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@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 bf715a367273..4cf80de4c471 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