]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: stmmac: change arguments to PCS handler and use dev_info()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Sun, 11 Jan 2026 13:15:24 +0000 (13:15 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 13 Jan 2026 03:36:49 +0000 (19:36 -0800)
Change the arguments to the PCS handler so that it can access the
struct device pointer and integrated PCS pointers.

This allows us to use the PCS register offset stored in struct
stmmac_pcs rather than passing it into the function, and also allows
the messages to be printed using dev_info() rather than pr_info(),
thereby allowing the stmmac instance to be identified.

Finally, as dev_info() identifies the driver/device, prefixing with
"stmmac_pcs: " is now redundant, so replace this with just "PCS ".

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1vevHw-00000002Yoz-35A7@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.c
drivers/net/ethernet/stmicro/stmmac/stmmac_pcs.h

index d288f03d37e457d087f879b3d5c0ecdfbeb3c930..af566636fad90313ebf50f49b111648a3078fa3d 100644 (file)
@@ -305,8 +305,7 @@ static int dwmac1000_irq_status(struct stmmac_priv *priv,
        }
 
        if (intr_status & (PCS_ANE_IRQ | PCS_LINK_IRQ))
-               stmmac_integrated_pcs_irq(ioaddr, GMAC_PCS_BASE, intr_status,
-                                         x);
+               stmmac_integrated_pcs_irq(priv, intr_status, x);
 
        return ret;
 }
index f78c95e61609f5c2bd442d7b0e8ea75bc7f0d71c..623868afe93d2ce518bb5482f82894b7a74fdf14 100644 (file)
@@ -659,8 +659,7 @@ static int dwmac4_irq_status(struct stmmac_priv *priv,
        }
 
        if (intr_status & (PCS_ANE_IRQ | PCS_LINK_IRQ))
-               stmmac_integrated_pcs_irq(ioaddr, GMAC_PCS_BASE, intr_status,
-                                         x);
+               stmmac_integrated_pcs_irq(priv, intr_status, x);
 
        return ret;
 }
index 90cdff30520beddad82340334ad1273f34a47d1d..28748e7ef7dd108b39d10760b4a83f5ea8fb943c 100644 (file)
@@ -45,33 +45,23 @@ static const struct phylink_pcs_ops dwmac_integrated_pcs_ops = {
        .pcs_config = dwmac_integrated_pcs_config,
 };
 
-/**
- * stmmac_integrated_pcs_irq - TBI, RTBI, or SGMII PHY ISR
- * @ioaddr: IO registers pointer
- * @reg: Base address of the AN Control Register.
- * @intr_status: GMAC core interrupt status
- * @x: pointer to log these events as stats
- * Description: it is the ISR for PCS events: Auto-Negotiation Completed and
- * Link status.
- */
-void stmmac_integrated_pcs_irq(void __iomem *ioaddr, u32 reg,
-                              unsigned int intr_status,
+void stmmac_integrated_pcs_irq(struct stmmac_priv *priv, u32 status,
                               struct stmmac_extra_stats *x)
 {
-       u32 val = readl(ioaddr + GMAC_AN_STATUS(reg));
+       struct stmmac_pcs *spcs = priv->integrated_pcs;
+       u32 val = readl(spcs->base + GMAC_AN_STATUS(0));
 
-       if (intr_status & PCS_ANE_IRQ) {
+       if (status & PCS_ANE_IRQ) {
                x->irq_pcs_ane_n++;
                if (val & GMAC_AN_STATUS_ANC)
-                       pr_info("stmmac_pcs: ANE process completed\n");
+                       dev_info(priv->device,
+                                "PCS ANE process completed\n");
        }
 
-       if (intr_status & PCS_LINK_IRQ) {
+       if (status & PCS_LINK_IRQ) {
                x->irq_pcs_link_n++;
-               if (val & GMAC_AN_STATUS_LS)
-                       pr_info("stmmac_pcs: Link Up\n");
-               else
-                       pr_info("stmmac_pcs: Link Down\n");
+               dev_info(priv->device, "PCS Link %s\n",
+                        val & GMAC_AN_STATUS_LS ? "Up" : "Down");
        }
 }
 
index bfc3d665265c0d97f0f8502e61eefdfc6ae3e06a..c4e6b242d39066656d86dfe7fdb245a94d34bc06 100644 (file)
@@ -62,8 +62,7 @@ phylink_pcs_to_stmmac_pcs(struct phylink_pcs *pcs)
        return container_of(pcs, struct stmmac_pcs, pcs);
 }
 
-void stmmac_integrated_pcs_irq(void __iomem *ioaddr, u32 reg,
-                              unsigned int intr_status,
+void stmmac_integrated_pcs_irq(struct stmmac_priv *priv, u32 status,
                               struct stmmac_extra_stats *x);
 int stmmac_integrated_pcs_init(struct stmmac_priv *priv, unsigned int offset,
                               u32 int_mask);