| Submitter | Giuseppe CAVALLARO |
|---|---|
| Date | March 6, 2012, 5:42 a.m. |
| Message ID | <1331012520-19574-1-git-send-email-peppe.cavallaro@st.com> |
| Download | mbox | patch |
| Permalink | /patch/144846/ |
| State | Changes Requested |
| Delegated to: | David Miller |
| Headers | show |
Comments
From: Giuseppe CAVALLARO <peppe.cavallaro@st.com> Date: Tue, 6 Mar 2012 06:42:00 +0100 > After commit "db8857b stmmac: use an unique MDIO bus name" and "90b9a54 > stmmac: fix phy naming inconsistency" stmmac cant work with other MDIO > buses, because mdio_bus name is fixed in the dirver. This sounds inaccurate, you're making it sound like these commits introduced this limitation, as far as I can tell they did not. Before the MDIO bus name was just plain "%x" and the bus_id number was placed there. Then it became the same thing, except with some (potentially fixed) prefix. Nothing about that change makes any difference whatsoever about what you're modifications are trying to allow. BTW, also, commit "90b9a54" is ambiguous. [davem@bql net]$ git show 90b9a54 error: short SHA1 90b9a54 is ambiguous. error: short SHA1 90b9a54 is ambiguous. fatal: ambiguous argument '90b9a54': unknown revision or path not in the working tree. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Patch
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 6ee593a..da891ef9b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -307,7 +307,13 @@ static int stmmac_init_phy(struct net_device *dev) priv->speed = 0; priv->oldduplex = -1; - snprintf(bus_id, MII_BUS_ID_SIZE, "stmmac-%x", priv->plat->bus_id); + if (priv->plat->phy_bus_name) + snprintf(bus_id, MII_BUS_ID_SIZE, "%s-%x", + priv->plat->phy_bus_name, priv->plat->bus_id); + else + snprintf(bus_id, MII_BUS_ID_SIZE, "stmmac-%x", + priv->plat->bus_id); + snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, bus_id, priv->plat->phy_addr); pr_debug("stmmac_init_phy: trying to attach to %s\n", phy_id); diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 0dddc9e..172b5e1 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -39,6 +39,7 @@ struct stmmac_mdio_bus_data { }; struct plat_stmmacenet_data { + char *phy_bus_name; int bus_id; int phy_addr; int interface;