summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/micrel
diff options
context:
space:
mode:
authorHarvey Hunt <harvey.hunt@imgtec.com>2016-05-17 14:33:27 +0100
committerDavid S. Miller <davem@davemloft.net>2016-05-17 12:30:19 -0400
commit3274940bd3d87043c74aa444ff3b0dff56b3e9ea (patch)
treebd29527f6b5d71dd3fedf614e087bf88be6a2044 /drivers/net/ethernet/micrel
parent39651abd28146fff2bfac63d68a7a56250a4aead (diff)
downloadblackbird-op-linux-3274940bd3d87043c74aa444ff3b0dff56b3e9ea.tar.gz
blackbird-op-linux-3274940bd3d87043c74aa444ff3b0dff56b3e9ea.zip
drivers: net: Don't print unpopulated net_device name
For ethernet devices, net_device.name will be eth%d before register_netdev() is called. Don't print the net_device name until the format string is replaced. Signed-off-by: Harvey Hunt <harvey.hunt@imgtec.com> Cc: Marcel Ziswiler <marcel@ziswiler.com> Cc: Robert Jarzmik <robert.jarzmik@free.fr> Cc: Barry Song <Baohua.Song@csr.com> Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/micrel')
-rw-r--r--drivers/net/ethernet/micrel/ks8695net.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/ethernet/micrel/ks8695net.c b/drivers/net/ethernet/micrel/ks8695net.c
index a8522d8af95d..20cb85bc0c5f 100644
--- a/drivers/net/ethernet/micrel/ks8695net.c
+++ b/drivers/net/ethernet/micrel/ks8695net.c
@@ -1354,6 +1354,7 @@ ks8695_probe(struct platform_device *pdev)
struct resource *rxirq_res, *txirq_res, *linkirq_res;
int ret = 0;
int buff_n;
+ bool inv_mac_addr = false;
u32 machigh, maclow;
/* Initialise a net_device */
@@ -1456,8 +1457,7 @@ ks8695_probe(struct platform_device *pdev)
ndev->dev_addr[5] = maclow & 0xFF;
if (!is_valid_ether_addr(ndev->dev_addr))
- dev_warn(ksp->dev, "%s: Invalid ethernet MAC address. Please "
- "set using ifconfig\n", ndev->name);
+ inv_mac_addr = true;
/* In order to be efficient memory-wise, we allocate both
* rings in one go.
@@ -1520,6 +1520,9 @@ ks8695_probe(struct platform_device *pdev)
ret = register_netdev(ndev);
if (ret == 0) {
+ if (inv_mac_addr)
+ dev_warn(ksp->dev, "%s: Invalid ethernet MAC address. Please set using ip\n",
+ ndev->name);
dev_info(ksp->dev, "ks8695 ethernet (%s) MAC: %pM\n",
ks8695_port_type(ksp), ndev->dev_addr);
} else {
OpenPOWER on IntegriCloud