diff options
| author | Jakub Kicinski <kuba@kernel.org> | 2026-03-10 05:45:31 +0300 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2026-03-10 05:45:31 +0300 |
| commit | 52ede1bce557c66309f41ac29dd190be23ca9129 (patch) | |
| tree | 2038eebd9e9451de3c0126810b2dfddb8c032c14 | |
| parent | c127d4087930cc4706b99c9431e35ba00776a634 (diff) | |
| parent | 687e7863f027426175791f8a23a59b7c4c816fe9 (diff) | |
| download | linux-52ede1bce557c66309f41ac29dd190be23ca9129.tar.xz | |
Merge branch 'net-stmmac-further-ptp-cleanups'
Russell King says:
====================
net: stmmac: further ptp cleanups
The first uses a local variable when setting n_ext_ts which is a minor
simplification of the code. The second removes the now unnecessary
"available" flag for the PPS outputs.
====================
Link: https://patch.msgid.link/aawDiK7DjcSXSs1X@shell.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
| -rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/dwmac5.c | 2 | ||||
| -rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c | 2 | ||||
| -rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 | ||||
| -rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 10 |
4 files changed, 4 insertions, 11 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac5.c b/drivers/net/ethernet/stmicro/stmmac/dwmac5.c index 1c431b918719..f1bb981cab7c 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac5.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac5.c @@ -525,8 +525,6 @@ int dwmac5_flex_pps_config(void __iomem *ioaddr, int index, u32 val = readl(ioaddr + MAC_PPS_CONTROL); u64 period; - if (!cfg->available) - return -EINVAL; if (tnsec & TRGTBUSY0) return -EBUSY; if (!sub_second_inc || !systime_flags) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c index 915e7c2ab11f..efa76b147f9e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c @@ -1162,8 +1162,6 @@ static int dwxgmac2_flex_pps_config(void __iomem *ioaddr, int index, u32 val = readl(ioaddr + XGMAC_PPS_CONTROL); u64 period; - if (!cfg->available) - return -EINVAL; if (tnsec & XGMAC_TRGTBUSY0) return -EBUSY; if (!sub_second_inc || !systime_flags) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h index 1fe96cd24b4f..335e60439b42 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h @@ -181,7 +181,6 @@ struct stmmac_tc_entry { #define STMMAC_PPS_MAX 4 struct stmmac_pps_cfg { - bool available; struct timespec64 start; struct timespec64 period; }; diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c index 98da499ba3b1..960249960004 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c @@ -335,7 +335,7 @@ const struct ptp_clock_info dwmac1000_ptp_clock_ops = { void stmmac_ptp_register(struct stmmac_priv *priv) { unsigned int pps_out_num = priv->dma_cap.pps_out_num; - int i; + unsigned int n_ext_ts; if (pps_out_num > STMMAC_PPS_MAX) { dev_warn(priv->device, @@ -344,9 +344,6 @@ void stmmac_ptp_register(struct stmmac_priv *priv) pps_out_num = STMMAC_PPS_MAX; } - for (i = 0; i < pps_out_num; i++) - priv->pps[i].available = true; - /* Calculate the clock domain crossing (CDC) error if necessary */ priv->plat->cdc_error_adj = 0; if (priv->plat->core_type == DWMAC_CORE_GMAC4) @@ -358,8 +355,9 @@ void stmmac_ptp_register(struct stmmac_priv *priv) if (pps_out_num) priv->ptp_clock_ops.n_per_out = pps_out_num; - if (priv->dma_cap.aux_snapshot_n) - priv->ptp_clock_ops.n_ext_ts = priv->dma_cap.aux_snapshot_n; + n_ext_ts = priv->dma_cap.aux_snapshot_n; + if (n_ext_ts) + priv->ptp_clock_ops.n_ext_ts = n_ext_ts; if (priv->plat->ptp_max_adj) priv->ptp_clock_ops.max_adj = priv->plat->ptp_max_adj; |
