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>
This commit is contained in:

committed by
David S. Miller

parent
1f9defa0c2
commit
d56631a66c
@@ -173,7 +173,6 @@ Where:
|
|||||||
For MDIO bus The we have:
|
For MDIO bus The we have:
|
||||||
|
|
||||||
struct stmmac_mdio_bus_data {
|
struct stmmac_mdio_bus_data {
|
||||||
int bus_id;
|
|
||||||
int (*phy_reset)(void *priv);
|
int (*phy_reset)(void *priv);
|
||||||
unsigned int phy_mask;
|
unsigned int phy_mask;
|
||||||
int *irqs;
|
int *irqs;
|
||||||
@@ -181,7 +180,6 @@ For MDIO bus The we have:
|
|||||||
};
|
};
|
||||||
|
|
||||||
Where:
|
Where:
|
||||||
o bus_id: bus identifier;
|
|
||||||
o phy_reset: hook to reset the phy device attached to the bus.
|
o phy_reset: hook to reset the phy device attached to the bus.
|
||||||
o phy_mask: phy mask passed when register the MDIO bus within the driver.
|
o phy_mask: phy mask passed when register the MDIO bus within the driver.
|
||||||
o irqs: list of IRQs, one per PHY.
|
o irqs: list of IRQs, one per PHY.
|
||||||
@@ -230,9 +228,6 @@ there are two MAC cores: one MAC is for MDIO Bus/PHY emulation
|
|||||||
with fixed_link support.
|
with fixed_link support.
|
||||||
|
|
||||||
static struct stmmac_mdio_bus_data stmmac1_mdio_bus = {
|
static struct stmmac_mdio_bus_data stmmac1_mdio_bus = {
|
||||||
.bus_id = 1,
|
|
||||||
|
|
|
||||||
|-> phy device on the bus_id 1
|
|
||||||
.phy_reset = phy_reset;
|
.phy_reset = phy_reset;
|
||||||
|
|
|
|
||||||
|-> function to provide the phy_reset on this board
|
|-> function to provide the phy_reset on this board
|
||||||
|
@@ -177,7 +177,7 @@ int stmmac_mdio_register(struct net_device *ndev)
|
|||||||
new_bus->write = &stmmac_mdio_write;
|
new_bus->write = &stmmac_mdio_write;
|
||||||
new_bus->reset = &stmmac_mdio_reset;
|
new_bus->reset = &stmmac_mdio_reset;
|
||||||
snprintf(new_bus->id, MII_BUS_ID_SIZE, "%s-%x",
|
snprintf(new_bus->id, MII_BUS_ID_SIZE, "%s-%x",
|
||||||
new_bus->name, mdio_bus_data->bus_id);
|
new_bus->name, priv->plat->bus_id);
|
||||||
new_bus->priv = ndev;
|
new_bus->priv = ndev;
|
||||||
new_bus->irq = irqlist;
|
new_bus->irq = irqlist;
|
||||||
new_bus->phy_mask = mdio_bus_data->phy_mask;
|
new_bus->phy_mask = mdio_bus_data->phy_mask;
|
||||||
@@ -213,12 +213,10 @@ int stmmac_mdio_register(struct net_device *ndev)
|
|||||||
* and no PHY number was provided to the MAC,
|
* and no PHY number was provided to the MAC,
|
||||||
* use the one probed here.
|
* use the one probed here.
|
||||||
*/
|
*/
|
||||||
if ((priv->plat->bus_id == mdio_bus_data->bus_id) &&
|
if (priv->plat->phy_addr == -1)
|
||||||
(priv->plat->phy_addr == -1))
|
|
||||||
priv->plat->phy_addr = addr;
|
priv->plat->phy_addr = addr;
|
||||||
|
|
||||||
act = (priv->plat->bus_id == mdio_bus_data->bus_id) &&
|
act = (priv->plat->phy_addr == addr);
|
||||||
(priv->plat->phy_addr == addr);
|
|
||||||
switch (phydev->irq) {
|
switch (phydev->irq) {
|
||||||
case PHY_POLL:
|
case PHY_POLL:
|
||||||
irq_str = "POLL";
|
irq_str = "POLL";
|
||||||
|
@@ -40,7 +40,6 @@ static void stmmac_default_data(void)
|
|||||||
plat_dat.has_gmac = 1;
|
plat_dat.has_gmac = 1;
|
||||||
plat_dat.force_sf_dma_mode = 1;
|
plat_dat.force_sf_dma_mode = 1;
|
||||||
|
|
||||||
mdio_data.bus_id = 1;
|
|
||||||
mdio_data.phy_reset = NULL;
|
mdio_data.phy_reset = NULL;
|
||||||
mdio_data.phy_mask = 0;
|
mdio_data.phy_mask = 0;
|
||||||
plat_dat.mdio_bus_data = &mdio_data;
|
plat_dat.mdio_bus_data = &mdio_data;
|
||||||
|
@@ -76,7 +76,6 @@
|
|||||||
/* Platfrom data for platform device structure's platform_data field */
|
/* Platfrom data for platform device structure's platform_data field */
|
||||||
|
|
||||||
struct stmmac_mdio_bus_data {
|
struct stmmac_mdio_bus_data {
|
||||||
int bus_id;
|
|
||||||
int (*phy_reset)(void *priv);
|
int (*phy_reset)(void *priv);
|
||||||
unsigned int phy_mask;
|
unsigned int phy_mask;
|
||||||
int *irqs;
|
int *irqs;
|
||||||
|
Reference in New Issue
Block a user