mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-24 09:50:04 +00:00
net: stmmac: Use the right logging function in stmmac_mdio_register
Currently, the function stmmac_mdio_register() is only used by stmmac_dvr_probe() from stmmac_main.c, in order to register the MDIO bus and probe information about the PHY. As this function is called before calling register_netdev(), all messages logged from stmmac_mdio_register are prefixed by "(unnamed net_device)". The goal of netdev_info or netdev_err is to dump useful infos about a net_device, when this data structure is partially initialized, there is no point for using these functions. This commit fixes the issue by replacing all netdev_*() by the corresponding dev_*() function for logging. The last netdev_info is replaced by phy_attached_info(), as a valid phydev can be used at this point. Signed-off-by: Romain Perier <romain.perier@collabora.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8d55373875
commit
fbca164776
1 changed files with 4 additions and 5 deletions
|
@ -204,6 +204,7 @@ int stmmac_mdio_register(struct net_device *ndev)
|
||||||
struct stmmac_priv *priv = netdev_priv(ndev);
|
struct stmmac_priv *priv = netdev_priv(ndev);
|
||||||
struct stmmac_mdio_bus_data *mdio_bus_data = priv->plat->mdio_bus_data;
|
struct stmmac_mdio_bus_data *mdio_bus_data = priv->plat->mdio_bus_data;
|
||||||
struct device_node *mdio_node = priv->plat->mdio_node;
|
struct device_node *mdio_node = priv->plat->mdio_node;
|
||||||
|
struct device *dev = ndev->dev.parent;
|
||||||
int addr, found;
|
int addr, found;
|
||||||
|
|
||||||
if (!mdio_bus_data)
|
if (!mdio_bus_data)
|
||||||
|
@ -237,7 +238,7 @@ int stmmac_mdio_register(struct net_device *ndev)
|
||||||
else
|
else
|
||||||
err = mdiobus_register(new_bus);
|
err = mdiobus_register(new_bus);
|
||||||
if (err != 0) {
|
if (err != 0) {
|
||||||
netdev_err(ndev, "Cannot register the MDIO bus\n");
|
dev_err(dev, "Cannot register the MDIO bus\n");
|
||||||
goto bus_register_fail;
|
goto bus_register_fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,14 +286,12 @@ int stmmac_mdio_register(struct net_device *ndev)
|
||||||
irq_str = irq_num;
|
irq_str = irq_num;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
netdev_info(ndev, "PHY ID %08x at %d IRQ %s (%s)%s\n",
|
phy_attached_info(phydev);
|
||||||
phydev->phy_id, addr, irq_str, phydev_name(phydev),
|
|
||||||
act ? " active" : "");
|
|
||||||
found = 1;
|
found = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!found && !mdio_node) {
|
if (!found && !mdio_node) {
|
||||||
netdev_warn(ndev, "No PHY found\n");
|
dev_warn(dev, "No PHY found\n");
|
||||||
mdiobus_unregister(new_bus);
|
mdiobus_unregister(new_bus);
|
||||||
mdiobus_free(new_bus);
|
mdiobus_free(new_bus);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
Loading…
Reference in a new issue