]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: stmmac: don't pass ioaddr to fix_soc_reset() method
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Mon, 26 Jan 2026 12:33:14 +0000 (12:33 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 28 Jan 2026 01:26:27 +0000 (17:26 -0800)
As the stmmac_priv struct is passed to the fix_soc_reset() method which
has the ioaddr, there is no need to pass ioaddr separately. Pass just
the stmmac_priv struct. Fix up the glues that use it.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Link: https://patch.msgid.link/E1vkLmM-00000005vE1-0nop@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
drivers/net/ethernet/stmicro/stmmac/hwif.c
include/linux/stmmac.h

index c722ff2dc1fcbce9358f3ebc89cd1c081721aacf..97de4726208e1bc01e4980da99ace72a3e2e1d54 100644 (file)
@@ -46,7 +46,7 @@ struct imx_dwmac_ops {
        u32 flags;
        bool mac_rgmii_txclk_auto_adj;
 
-       int (*fix_soc_reset)(struct stmmac_priv *priv, void __iomem *ioaddr);
+       int (*fix_soc_reset)(struct stmmac_priv *priv);
        int (*set_intf_mode)(struct imx_priv_data *dwmac, u8 phy_intf_sel);
        void (*fix_mac_speed)(void *priv, int speed, unsigned int mode);
 };
@@ -220,12 +220,14 @@ static void imx93_dwmac_fix_speed(void *priv, int speed, unsigned int mode)
        writel(old_ctrl, dwmac->base_addr + MAC_CTRL_REG);
 }
 
-static int imx_dwmac_mx93_reset(struct stmmac_priv *priv, void __iomem *ioaddr)
+static int imx_dwmac_mx93_reset(struct stmmac_priv *priv)
 {
        struct plat_stmmacenet_data *plat_dat = priv->plat;
-       u32 value = readl(ioaddr + DMA_BUS_MODE);
+       void __iomem *ioaddr = priv->ioaddr;
+       u32 value;
 
        /* DMA SW reset */
+       value = readl(ioaddr + DMA_BUS_MODE);
        value |= DMA_BUS_MODE_SFT_RESET;
        writel(value, ioaddr + DMA_BUS_MODE);
 
index 4f2b5bd6cb314fef0cc4d6e2cc1d4a5f75f175e8..ed0b534d8d7b04712227e36991b69c9d5ff5011f 100644 (file)
@@ -485,10 +485,12 @@ static int loongson_dwmac_acpi_config(struct pci_dev *pdev,
 }
 
 /* Loongson's DWMAC device may take nearly two seconds to complete DMA reset */
-static int loongson_dwmac_fix_reset(struct stmmac_priv *priv, void __iomem *ioaddr)
+static int loongson_dwmac_fix_reset(struct stmmac_priv *priv)
 {
-       u32 value = readl(ioaddr + DMA_BUS_MODE);
+       void __iomem *ioaddr = priv->ioaddr;
+       u32 value;
 
+       value = readl(ioaddr + DMA_BUS_MODE);
        if (value & DMA_BUS_MODE_SFT_RESET) {
                netdev_err(priv->dev, "the PHY clock is missing\n");
                return -EINVAL;
index 014f7cd79a3ccc9ba6a4b683200cde23663681dc..7e69ff4b9a98d7ff9fcb419d1aa284bf4e196490 100644 (file)
@@ -109,7 +109,7 @@ int stmmac_reset(struct stmmac_priv *priv)
        void __iomem *ioaddr = priv->ioaddr;
 
        if (plat && plat->fix_soc_reset)
-               return plat->fix_soc_reset(priv, ioaddr);
+               return plat->fix_soc_reset(priv);
 
        return stmmac_do_callback(priv, dma, reset, ioaddr);
 }
index e308c98c7bd33bc62746c4f73f169bc554162ee2..5199451dd0bc0b22efbf9cad36a1c53e621db6d6 100644 (file)
@@ -257,7 +257,7 @@ struct plat_stmmacenet_data {
        int (*set_clk_tx_rate)(void *priv, struct clk *clk_tx_i,
                               phy_interface_t interface, int speed);
        void (*fix_mac_speed)(void *priv, int speed, unsigned int mode);
-       int (*fix_soc_reset)(struct stmmac_priv *priv, void __iomem *ioaddr);
+       int (*fix_soc_reset)(struct stmmac_priv *priv);
        int (*serdes_powerup)(struct net_device *ndev, void *priv);
        void (*serdes_powerdown)(struct net_device *ndev, void *priv);
        int (*mac_finish)(struct net_device *ndev,