net: stmmac: use dev_info() before netdev is registered
authorJisheng Zhang <Jisheng.Zhang@synaptics.com>
Tue, 28 May 2019 07:02:07 +0000 (07:02 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 May 2019 20:26:18 +0000 (13:26 -0700)
Before the netdev is registered, calling netdev_info() will emit
something as "(unnamed net device) (uninitialized)", looks confusing.

Before this patch:
[    3.155028] stmmaceth f7b60000.ethernet (unnamed net_device) (uninitialized): device MAC address 52:1a:55:18:9e:9d

After this patch:
[    3.155028] stmmaceth f7b60000.ethernet: device MAC address 52:1a:55:18:9e:9d

Signed-off-by: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

index a87ec70b19f1786997fca97d7c476f09f90bc97a..7a6afd3f8fced6d123348830fd13a0508ea977eb 100644 (file)
@@ -2167,8 +2167,8 @@ static void stmmac_check_ether_addr(struct stmmac_priv *priv)
                stmmac_get_umac_addr(priv, priv->hw, priv->dev->dev_addr, 0);
                if (!is_valid_ether_addr(priv->dev->dev_addr))
                        eth_hw_addr_random(priv->dev);
-               netdev_info(priv->dev, "device MAC address %pM\n",
-                           priv->dev->dev_addr);
+               dev_info(priv->device, "device MAC address %pM\n",
+                        priv->dev->dev_addr);
        }
 }