Skip to content

Commit

Permalink
net: stmmac: print stmmac_init_dma_engine() errors using netdev_err()
Browse files Browse the repository at this point in the history
stmmac_init_dma_engine() uses dev_err() which leads to errors being
reported as e.g:

dwc-eth-dwmac 2490000.ethernet: Failed to reset the dma
dwc-eth-dwmac 2490000.ethernet eth0: stmmac_hw_setup: DMA engine initialization failed

stmmac_init_dma_engine() is only called from stmmac_hw_setup() which
itself uses netdev_err(), and we will have a net_device setup. So,
change the dev_err() to netdev_err() to give consistent error
messages.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1tl5y1-004UgG-8X@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Russell King (Oracle) authored and Jakub Kicinski committed Feb 22, 2025
1 parent 465b210 commit 3e40181
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3047,7 +3047,7 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv)
int ret = 0;

if (!priv->plat->dma_cfg || !priv->plat->dma_cfg->pbl) {
dev_err(priv->device, "Invalid DMA configuration\n");
netdev_err(priv->dev, "Invalid DMA configuration\n");
return -EINVAL;
}

Expand All @@ -3056,7 +3056,7 @@ static int stmmac_init_dma_engine(struct stmmac_priv *priv)

ret = stmmac_reset(priv, priv->ioaddr);
if (ret) {
dev_err(priv->device, "Failed to reset the dma\n");
netdev_err(priv->dev, "Failed to reset the dma\n");
return ret;
}

Expand Down

0 comments on commit 3e40181

Please sign in to comment.