提交 7b5dc0dd 编写于 作者: J Jon Ringle 提交者: David S. Miller

net: encx24j600: move rev announcement to probe function

When encx24j600 is open and closed many times due to userspace polling the
interface, the log gets noise with this log message.

Moving this to encx24j600_spi_probe function where it belongs.
Signed-off-by: NJon Ringle <jringle@gridpoint.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 85c72ba1
...@@ -600,22 +600,11 @@ static void encx24j600_set_rxfilter_mode(struct encx24j600_priv *priv) ...@@ -600,22 +600,11 @@ static void encx24j600_set_rxfilter_mode(struct encx24j600_priv *priv)
static int encx24j600_hw_init(struct encx24j600_priv *priv) static int encx24j600_hw_init(struct encx24j600_priv *priv)
{ {
struct net_device *dev = priv->ndev;
int ret = 0; int ret = 0;
u16 eidled;
u16 macon2; u16 macon2;
priv->hw_enabled = false; priv->hw_enabled = false;
eidled = encx24j600_read_reg(priv, EIDLED);
if (((eidled & DEVID_MASK) >> DEVID_SHIFT) != ENCX24J600_DEV_ID) {
ret = -EINVAL;
goto err_out;
}
netif_info(priv, drv, dev, "Silicon rev ID: 0x%02x\n",
(eidled & REVID_MASK) >> REVID_SHIFT);
/* PHY Leds: link status, /* PHY Leds: link status,
* LEDA: Link State + collision events * LEDA: Link State + collision events
* LEDB: Link State + transmit/receive events * LEDB: Link State + transmit/receive events
...@@ -655,7 +644,6 @@ static int encx24j600_hw_init(struct encx24j600_priv *priv) ...@@ -655,7 +644,6 @@ static int encx24j600_hw_init(struct encx24j600_priv *priv)
if (netif_msg_hw(priv)) if (netif_msg_hw(priv))
encx24j600_dump_config(priv, "Hw is initialized"); encx24j600_dump_config(priv, "Hw is initialized");
err_out:
return ret; return ret;
} }
...@@ -1004,6 +992,7 @@ static int encx24j600_spi_probe(struct spi_device *spi) ...@@ -1004,6 +992,7 @@ static int encx24j600_spi_probe(struct spi_device *spi)
struct net_device *ndev; struct net_device *ndev;
struct encx24j600_priv *priv; struct encx24j600_priv *priv;
u16 eidled;
ndev = alloc_etherdev(sizeof(struct encx24j600_priv)); ndev = alloc_etherdev(sizeof(struct encx24j600_priv));
...@@ -1072,10 +1061,21 @@ static int encx24j600_spi_probe(struct spi_device *spi) ...@@ -1072,10 +1061,21 @@ static int encx24j600_spi_probe(struct spi_device *spi)
goto out_free; goto out_free;
} }
eidled = encx24j600_read_reg(priv, EIDLED);
if (((eidled & DEVID_MASK) >> DEVID_SHIFT) != ENCX24J600_DEV_ID) {
ret = -EINVAL;
goto out_unregister;
}
netif_info(priv, probe, ndev, "Silicon rev ID: 0x%02x\n",
(eidled & REVID_MASK) >> REVID_SHIFT);
netif_info(priv, drv, priv->ndev, "MAC address %pM\n", ndev->dev_addr); netif_info(priv, drv, priv->ndev, "MAC address %pM\n", ndev->dev_addr);
return ret; return ret;
out_unregister:
unregister_netdev(priv->ndev);
out_free: out_free:
free_netdev(ndev); free_netdev(ndev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册