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

net:stmmac: Remove bus_id from mdio platform data.

This patch removes bus_id from mdio platform data, The reason to remove
bus_id is, stmmac mdio bus_id is always same as stmmac bus-id, so there
is no point in passing this in different variable.
Also stmmac ethernet driver connects to phy with bus_id passed its
platform data.
So, having single bus-id is much simpler.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Srinivas Kandagatla and committed by
David S. Miller
d56631a6 1f9defa0

+3 -12
-5
Documentation/networking/stmmac.txt
··· 173 173 For MDIO bus The we have: 174 174 175 175 struct stmmac_mdio_bus_data { 176 - int bus_id; 177 176 int (*phy_reset)(void *priv); 178 177 unsigned int phy_mask; 179 178 int *irqs; ··· 180 181 }; 181 182 182 183 Where: 183 - o bus_id: bus identifier; 184 184 o phy_reset: hook to reset the phy device attached to the bus. 185 185 o phy_mask: phy mask passed when register the MDIO bus within the driver. 186 186 o irqs: list of IRQs, one per PHY. ··· 228 230 with fixed_link support. 229 231 230 232 static struct stmmac_mdio_bus_data stmmac1_mdio_bus = { 231 - .bus_id = 1, 232 - | 233 - |-> phy device on the bus_id 1 234 233 .phy_reset = phy_reset; 235 234 | 236 235 |-> function to provide the phy_reset on this board
+3 -5
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
··· 177 177 new_bus->write = &stmmac_mdio_write; 178 178 new_bus->reset = &stmmac_mdio_reset; 179 179 snprintf(new_bus->id, MII_BUS_ID_SIZE, "%s-%x", 180 - new_bus->name, mdio_bus_data->bus_id); 180 + new_bus->name, priv->plat->bus_id); 181 181 new_bus->priv = ndev; 182 182 new_bus->irq = irqlist; 183 183 new_bus->phy_mask = mdio_bus_data->phy_mask; ··· 213 213 * and no PHY number was provided to the MAC, 214 214 * use the one probed here. 215 215 */ 216 - if ((priv->plat->bus_id == mdio_bus_data->bus_id) && 217 - (priv->plat->phy_addr == -1)) 216 + if (priv->plat->phy_addr == -1) 218 217 priv->plat->phy_addr = addr; 219 218 220 - act = (priv->plat->bus_id == mdio_bus_data->bus_id) && 221 - (priv->plat->phy_addr == addr); 219 + act = (priv->plat->phy_addr == addr); 222 220 switch (phydev->irq) { 223 221 case PHY_POLL: 224 222 irq_str = "POLL";
-1
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
··· 40 40 plat_dat.has_gmac = 1; 41 41 plat_dat.force_sf_dma_mode = 1; 42 42 43 - mdio_data.bus_id = 1; 44 43 mdio_data.phy_reset = NULL; 45 44 mdio_data.phy_mask = 0; 46 45 plat_dat.mdio_bus_data = &mdio_data;
-1
include/linux/stmmac.h
··· 76 76 /* Platfrom data for platform device structure's platform_data field */ 77 77 78 78 struct stmmac_mdio_bus_data { 79 - int bus_id; 80 79 int (*phy_reset)(void *priv); 81 80 unsigned int phy_mask; 82 81 int *irqs;