mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 23:05:25 -04:00
net: stmmac: move PTP support check into stmmac_init_timestamping()
Move the PTP support check from stmmac_init_tstamp_counter() into stmmac_init_timestamping() as it makes more sense to be there. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
84b994ac4e
commit
9d5059228c
@@ -734,9 +734,6 @@ static int stmmac_init_tstamp_counter(struct stmmac_priv *priv,
|
||||
u32 sec_inc = 0;
|
||||
u64 temp = 0;
|
||||
|
||||
if (!(priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (!priv->plat->clk_ptp_rate) {
|
||||
netdev_err(priv->dev, "Invalid PTP clock rate");
|
||||
return -EINVAL;
|
||||
@@ -787,12 +784,14 @@ static int stmmac_init_timestamping(struct stmmac_priv *priv)
|
||||
if (priv->plat->ptp_clk_freq_config)
|
||||
priv->plat->ptp_clk_freq_config(priv);
|
||||
|
||||
if (!(priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp)) {
|
||||
netdev_info(priv->dev, "PTP not supported by HW\n");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
ret = stmmac_init_tstamp_counter(priv, STMMAC_HWTS_ACTIVE);
|
||||
if (ret) {
|
||||
if (ret == -EOPNOTSUPP)
|
||||
netdev_info(priv->dev, "PTP not supported by HW\n");
|
||||
else
|
||||
netdev_warn(priv->dev, "PTP init failed\n");
|
||||
netdev_warn(priv->dev, "PTP init failed\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user