Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: stmmac: don't pass ioaddr to fix_soc_reset() method

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>

authored by

Russell King (Oracle) and committed by
Jakub Kicinski
d64f761d 3b721117

+11 -7
+5 -3
drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c
··· 46 46 u32 flags; 47 47 bool mac_rgmii_txclk_auto_adj; 48 48 49 - int (*fix_soc_reset)(struct stmmac_priv *priv, void __iomem *ioaddr); 49 + int (*fix_soc_reset)(struct stmmac_priv *priv); 50 50 int (*set_intf_mode)(struct imx_priv_data *dwmac, u8 phy_intf_sel); 51 51 void (*fix_mac_speed)(void *priv, int speed, unsigned int mode); 52 52 }; ··· 220 220 writel(old_ctrl, dwmac->base_addr + MAC_CTRL_REG); 221 221 } 222 222 223 - static int imx_dwmac_mx93_reset(struct stmmac_priv *priv, void __iomem *ioaddr) 223 + static int imx_dwmac_mx93_reset(struct stmmac_priv *priv) 224 224 { 225 225 struct plat_stmmacenet_data *plat_dat = priv->plat; 226 - u32 value = readl(ioaddr + DMA_BUS_MODE); 226 + void __iomem *ioaddr = priv->ioaddr; 227 + u32 value; 227 228 228 229 /* DMA SW reset */ 230 + value = readl(ioaddr + DMA_BUS_MODE); 229 231 value |= DMA_BUS_MODE_SFT_RESET; 230 232 writel(value, ioaddr + DMA_BUS_MODE); 231 233
+4 -2
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson.c
··· 485 485 } 486 486 487 487 /* Loongson's DWMAC device may take nearly two seconds to complete DMA reset */ 488 - static int loongson_dwmac_fix_reset(struct stmmac_priv *priv, void __iomem *ioaddr) 488 + static int loongson_dwmac_fix_reset(struct stmmac_priv *priv) 489 489 { 490 - u32 value = readl(ioaddr + DMA_BUS_MODE); 490 + void __iomem *ioaddr = priv->ioaddr; 491 + u32 value; 491 492 493 + value = readl(ioaddr + DMA_BUS_MODE); 492 494 if (value & DMA_BUS_MODE_SFT_RESET) { 493 495 netdev_err(priv->dev, "the PHY clock is missing\n"); 494 496 return -EINVAL;
+1 -1
drivers/net/ethernet/stmicro/stmmac/hwif.c
··· 109 109 void __iomem *ioaddr = priv->ioaddr; 110 110 111 111 if (plat && plat->fix_soc_reset) 112 - return plat->fix_soc_reset(priv, ioaddr); 112 + return plat->fix_soc_reset(priv); 113 113 114 114 return stmmac_do_callback(priv, dma, reset, ioaddr); 115 115 }
+1 -1
include/linux/stmmac.h
··· 257 257 int (*set_clk_tx_rate)(void *priv, struct clk *clk_tx_i, 258 258 phy_interface_t interface, int speed); 259 259 void (*fix_mac_speed)(void *priv, int speed, unsigned int mode); 260 - int (*fix_soc_reset)(struct stmmac_priv *priv, void __iomem *ioaddr); 260 + int (*fix_soc_reset)(struct stmmac_priv *priv); 261 261 int (*serdes_powerup)(struct net_device *ndev, void *priv); 262 262 void (*serdes_powerdown)(struct net_device *ndev, void *priv); 263 263 int (*mac_finish)(struct net_device *ndev,