Skip to content

Commit

Permalink
Merge branch 'mdio_reset-next'
Browse files Browse the repository at this point in the history
Florian Fainelli says:

====================
net: remove empty MDIO bus reset functions

This patchset removes all empty MDIO bus reset functions that we have in the
tree (hopefully all of them). This function is optional for the MDIO bus code in
drivers/net/phy/mdio_bus.c::mdiobus_register, the documentation is updated to
reflect that.

Having less call sites to update will allow us to implement a generic BMCR_RESET
based PHY reset for MDIO buses that require to reset their PHYs before their
PHY detection succeeds (e.g: HiSilicon hip04 current submission) and provide it
as a helper.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Mar 28, 2014
2 parents ebe5e3c + 604fdf4 commit e125003
Show file tree
Hide file tree
Showing 14 changed files with 1 addition and 87 deletions.
2 changes: 1 addition & 1 deletion Documentation/networking/phy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ The MDIO bus
time, so it is safe for them to block, waiting for an interrupt to signal
the operation is complete

2) A reset function is necessary. This is used to return the bus to an
2) A reset function is optional. This is used to return the bus to an
initialized state.

3) A probe function is needed. This function should set up anything the bus
Expand Down
6 changes: 0 additions & 6 deletions drivers/net/ethernet/adi/bfin_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,6 @@ static int bfin_mdiobus_write(struct mii_bus *bus, int phy_addr, int regnum,
return bfin_mdio_poll();
}

static int bfin_mdiobus_reset(struct mii_bus *bus)
{
return 0;
}

static void bfin_mac_adjust_link(struct net_device *dev)
{
struct bfin_mac_local *lp = netdev_priv(dev);
Expand Down Expand Up @@ -1824,7 +1819,6 @@ static int bfin_mii_bus_probe(struct platform_device *pdev)
goto out_err_alloc;
miibus->read = bfin_mdiobus_read;
miibus->write = bfin_mdiobus_write;
miibus->reset = bfin_mdiobus_reset;

miibus->parent = &pdev->dev;
miibus->name = "bfin_mii_bus";
Expand Down
6 changes: 0 additions & 6 deletions drivers/net/ethernet/aeroflex/greth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1213,11 +1213,6 @@ static int greth_mdio_write(struct mii_bus *bus, int phy, int reg, u16 val)
return 0;
}

static int greth_mdio_reset(struct mii_bus *bus)
{
return 0;
}

static void greth_link_change(struct net_device *dev)
{
struct greth_private *greth = netdev_priv(dev);
Expand Down Expand Up @@ -1332,7 +1327,6 @@ static int greth_mdio_init(struct greth_private *greth)
snprintf(greth->mdio->id, MII_BUS_ID_SIZE, "%s-%d", greth->mdio->name, greth->irq);
greth->mdio->read = greth_mdio_read;
greth->mdio->write = greth_mdio_write;
greth->mdio->reset = greth_mdio_reset;
greth->mdio->priv = greth;

greth->mdio->irq = greth->mdio_irqs;
Expand Down
6 changes: 0 additions & 6 deletions drivers/net/ethernet/broadcom/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1401,11 +1401,6 @@ static int tg3_mdio_write(struct mii_bus *bp, int mii_id, int reg, u16 val)
return ret;
}

static int tg3_mdio_reset(struct mii_bus *bp)
{
return 0;
}

static void tg3_mdio_config_5785(struct tg3 *tp)
{
u32 val;
Expand Down Expand Up @@ -1542,7 +1537,6 @@ static int tg3_mdio_init(struct tg3 *tp)
tp->mdio_bus->parent = &tp->pdev->dev;
tp->mdio_bus->read = &tg3_mdio_read;
tp->mdio_bus->write = &tg3_mdio_write;
tp->mdio_bus->reset = &tg3_mdio_reset;
tp->mdio_bus->phy_mask = ~(1 << tp->phy_addr);
tp->mdio_bus->irq = &tp->mdio_irq[0];

Expand Down
6 changes: 0 additions & 6 deletions drivers/net/ethernet/cadence/macb.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,6 @@ static int macb_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
return 0;
}

static int macb_mdio_reset(struct mii_bus *bus)
{
return 0;
}

/**
* macb_set_tx_clk() - Set a clock to a new frequency
* @clk Pointer to the clock to change
Expand Down Expand Up @@ -375,7 +370,6 @@ int macb_mii_init(struct macb *bp)
bp->mii_bus->name = "MACB_mii_bus";
bp->mii_bus->read = &macb_mdio_read;
bp->mii_bus->write = &macb_mdio_write;
bp->mii_bus->reset = &macb_mdio_reset;
snprintf(bp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
bp->pdev->name, bp->pdev->id);
bp->mii_bus->priv = bp;
Expand Down
6 changes: 0 additions & 6 deletions drivers/net/ethernet/dnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,6 @@ static int dnet_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
return 0;
}

static int dnet_mdio_reset(struct mii_bus *bus)
{
return 0;
}

static void dnet_handle_link_change(struct net_device *dev)
{
struct dnet *bp = netdev_priv(dev);
Expand Down Expand Up @@ -322,7 +317,6 @@ static int dnet_mii_init(struct dnet *bp)
bp->mii_bus->name = "dnet_mii_bus";
bp->mii_bus->read = &dnet_mdio_read;
bp->mii_bus->write = &dnet_mdio_write;
bp->mii_bus->reset = &dnet_mdio_reset;

snprintf(bp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
bp->pdev->name, bp->pdev->id);
Expand Down
6 changes: 0 additions & 6 deletions drivers/net/ethernet/ethoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -660,11 +660,6 @@ static int ethoc_mdio_write(struct mii_bus *bus, int phy, int reg, u16 val)
return -EBUSY;
}

static int ethoc_mdio_reset(struct mii_bus *bus)
{
return 0;
}

static void ethoc_mdio_poll(struct net_device *dev)
{
}
Expand Down Expand Up @@ -1210,7 +1205,6 @@ static int ethoc_probe(struct platform_device *pdev)
priv->mdio->name, pdev->id);
priv->mdio->read = ethoc_mdio_read;
priv->mdio->write = ethoc_mdio_write;
priv->mdio->reset = ethoc_mdio_reset;
priv->mdio->priv = priv;

priv->mdio->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
Expand Down
6 changes: 0 additions & 6 deletions drivers/net/ethernet/faraday/ftgmac100.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,11 +940,6 @@ static int ftgmac100_mdiobus_write(struct mii_bus *bus, int phy_addr,
return -EIO;
}

static int ftgmac100_mdiobus_reset(struct mii_bus *bus)
{
return 0;
}

/******************************************************************************
* struct ethtool_ops functions
*****************************************************************************/
Expand Down Expand Up @@ -1262,7 +1257,6 @@ static int ftgmac100_probe(struct platform_device *pdev)
priv->mii_bus->priv = netdev;
priv->mii_bus->read = ftgmac100_mdiobus_read;
priv->mii_bus->write = ftgmac100_mdiobus_write;
priv->mii_bus->reset = ftgmac100_mdiobus_reset;
priv->mii_bus->irq = priv->phy_irq;

for (i = 0; i < PHY_MAX_ADDR; i++)
Expand Down
6 changes: 0 additions & 6 deletions drivers/net/ethernet/freescale/fec_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1255,11 +1255,6 @@ static int fec_enet_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
return 0;
}

static int fec_enet_mdio_reset(struct mii_bus *bus)
{
return 0;
}

static int fec_enet_mii_probe(struct net_device *ndev)
{
struct fec_enet_private *fep = netdev_priv(ndev);
Expand Down Expand Up @@ -1384,7 +1379,6 @@ static int fec_enet_mii_init(struct platform_device *pdev)
fep->mii_bus->name = "fec_enet_mii_bus";
fep->mii_bus->read = fec_enet_mdio_read;
fep->mii_bus->write = fec_enet_mdio_write;
fep->mii_bus->reset = fec_enet_mdio_reset;
snprintf(fep->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
pdev->name, fep->dev_id + 1);
fep->mii_bus->priv = fep;
Expand Down
7 changes: 0 additions & 7 deletions drivers/net/ethernet/freescale/fs_enet/mii-fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,6 @@ static int fs_enet_fec_mii_write(struct mii_bus *bus, int phy_id, int location,

}

static int fs_enet_fec_mii_reset(struct mii_bus *bus)
{
/* nothing here - for now */
return 0;
}

static struct of_device_id fs_enet_mdio_fec_match[];
static int fs_enet_mdio_probe(struct platform_device *ofdev)
{
Expand Down Expand Up @@ -128,7 +122,6 @@ static int fs_enet_mdio_probe(struct platform_device *ofdev)
new_bus->name = "FEC MII Bus";
new_bus->read = &fs_enet_fec_mii_read;
new_bus->write = &fs_enet_fec_mii_write;
new_bus->reset = &fs_enet_fec_mii_reset;

ret = of_address_to_resource(ofdev->dev.of_node, 0, &res);
if (ret)
Expand Down
6 changes: 0 additions & 6 deletions drivers/net/ethernet/marvell/mvmdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,6 @@ static int orion_mdio_write(struct mii_bus *bus, int mii_id,
return ret;
}

static int orion_mdio_reset(struct mii_bus *bus)
{
return 0;
}

static irqreturn_t orion_mdio_err_irq(int irq, void *dev_id)
{
struct orion_mdio_dev *dev = dev_id;
Expand Down Expand Up @@ -209,7 +204,6 @@ static int orion_mdio_probe(struct platform_device *pdev)
bus->name = "orion_mdio_bus";
bus->read = orion_mdio_read;
bus->write = orion_mdio_write;
bus->reset = orion_mdio_reset;
snprintf(bus->id, MII_BUS_ID_SIZE, "%s-mii",
dev_name(&pdev->dev));
bus->parent = &pdev->dev;
Expand Down
6 changes: 0 additions & 6 deletions drivers/net/ethernet/rdc/r6040.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,6 @@ static int r6040_mdiobus_write(struct mii_bus *bus, int phy_addr,
return r6040_phy_write(ioaddr, phy_addr, reg, value);
}

static int r6040_mdiobus_reset(struct mii_bus *bus)
{
return 0;
}

static void r6040_free_txbufs(struct net_device *dev)
{
struct r6040_private *lp = netdev_priv(dev);
Expand Down Expand Up @@ -1191,7 +1186,6 @@ static int r6040_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
lp->mii_bus->priv = dev;
lp->mii_bus->read = r6040_mdiobus_read;
lp->mii_bus->write = r6040_mdiobus_write;
lp->mii_bus->reset = r6040_mdiobus_reset;
lp->mii_bus->name = "r6040_eth_mii";
snprintf(lp->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
dev_name(&pdev->dev), card_idx);
Expand Down
13 changes: 0 additions & 13 deletions drivers/net/ethernet/xilinx/xilinx_emaclite.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,18 +794,6 @@ static int xemaclite_mdio_write(struct mii_bus *bus, int phy_id, int reg,
return 0;
}

/**
* xemaclite_mdio_reset - Reset the mdio bus.
* @bus: Pointer to the MII bus
*
* This function is required(?) as per Documentation/networking/phy.txt.
* There is no reset in this device; this function always returns 0.
*/
static int xemaclite_mdio_reset(struct mii_bus *bus)
{
return 0;
}

/**
* xemaclite_mdio_setup - Register mii_bus for the Emaclite device
* @lp: Pointer to the Emaclite device private data
Expand Down Expand Up @@ -861,7 +849,6 @@ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev)
bus->name = "Xilinx Emaclite MDIO";
bus->read = xemaclite_mdio_read;
bus->write = xemaclite_mdio_write;
bus->reset = xemaclite_mdio_reset;
bus->parent = dev;
bus->irq = lp->mdio_irqs; /* preallocated IRQ table */

Expand Down
6 changes: 0 additions & 6 deletions drivers/net/phy/mdio-sun4i.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@ static int sun4i_mdio_write(struct mii_bus *bus, int mii_id, int regnum,
return 0;
}

static int sun4i_mdio_reset(struct mii_bus *bus)
{
return 0;
}

static int sun4i_mdio_probe(struct platform_device *pdev)
{
struct device_node *np = pdev->dev.of_node;
Expand All @@ -110,7 +105,6 @@ static int sun4i_mdio_probe(struct platform_device *pdev)
bus->name = "sun4i_mii_bus";
bus->read = &sun4i_mdio_read;
bus->write = &sun4i_mdio_write;
bus->reset = &sun4i_mdio_reset;
snprintf(bus->id, MII_BUS_ID_SIZE, "%s-mii", dev_name(&pdev->dev));
bus->parent = &pdev->dev;

Expand Down

0 comments on commit e125003

Please sign in to comment.