]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: stmmac: ptp: remove redundant priv->pps[].available
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Sat, 7 Mar 2026 10:53:20 +0000 (10:53 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 10 Mar 2026 02:45:27 +0000 (19:45 -0700)
priv->pps[].available is set in stmmac_ptp_register() for all PPS
outputs reported by hardware up to STMMAC_PPS_MAX.

Since we now set priv->ptp_clock_ops.n_per_out to the number of PPS
outputs that both the hardware and driver can support to prevent
array overflow in stmmac_enable(), this makes priv->pps[].available
redundant. Remove this struct member.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1vypHc-0000000CSbl-1X6v@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac5.c
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_core.c
drivers/net/ethernet/stmicro/stmmac/stmmac.h
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c

index 1c431b918719e2582ce52639985596010206be70..f1bb981cab7cd924580cfb654b708c79e85e8829 100644 (file)
@@ -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)
index 915e7c2ab11f13421dbd6a4a80c491ec9ab19473..efa76b147f9e567497f49842b43cec83a46748bb 100644 (file)
@@ -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)
index 1fe96cd24b4fe833a15673b757cfc2564bfd8675..335e60439b42fca009811d42b7d6b0e6d6c6187d 100644 (file)
@@ -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;
 };
index 654d04f8c373a7f796d73b5e904f95186a811365..960249960004c55fa02db2184d1d460b77596504 100644 (file)
@@ -336,7 +336,6 @@ void stmmac_ptp_register(struct stmmac_priv *priv)
 {
        unsigned int pps_out_num = priv->dma_cap.pps_out_num;
        unsigned int n_ext_ts;
-       int i;
 
        if (pps_out_num > STMMAC_PPS_MAX) {
                dev_warn(priv->device,
@@ -345,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)