net: stmmac: move stmmac_init_ptp() messages into function

Move the stmmac_init_ptp() messages from stmmac_hw_setup() to
stmmac_init_ptp(), which will allow further cleanups.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Russell King (Oracle) 2025-09-11 12:10:07 +01:00 committed by Jakub Kicinski
parent 67ec43792b
commit 4fbd180acd

View File

@ -788,8 +788,13 @@ static int stmmac_init_ptp(struct stmmac_priv *priv)
priv->plat->ptp_clk_freq_config(priv);
ret = stmmac_init_tstamp_counter(priv, STMMAC_HWTS_ACTIVE);
if (ret)
if (ret) {
if (ret == -EOPNOTSUPP)
netdev_info(priv->dev, "PTP not supported by HW\n");
else
netdev_warn(priv->dev, "PTP init failed\n");
return ret;
}
priv->adv_ts = 0;
/* Check if adv_ts can be enabled for dwmac 4.x / xgmac core */
@ -3497,12 +3502,7 @@ static int stmmac_hw_setup(struct net_device *dev, bool ptp_register)
ERR_PTR(ret));
}
ret = stmmac_init_ptp(priv);
if (ret == -EOPNOTSUPP)
netdev_info(priv->dev, "PTP not supported by HW\n");
else if (ret)
netdev_warn(priv->dev, "PTP init failed\n");
else if (ptp_register)
if (stmmac_init_ptp(priv) == 0 && ptp_register)
stmmac_ptp_register(priv);
if (priv->use_riwt) {