diff options
author | Grant Likely <grant.likely@secretlab.ca> | 2009-04-25 12:53:33 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-27 02:53:51 -0700 |
commit | aa73832c5a80d6c52c69b18af858d88fa595dd3c (patch) | |
tree | 8649f4137178fc1cb6f3c1116fe713b937a82f61 /drivers/net/fs_enet/mii-fec.c | |
parent | fd84f0ee50d3abedd11454b016823aa3ffcdc919 (diff) |
net: Rework fs_enet driver to use of_mdio infrastructure
This patch simplifies the driver by making use of more common code.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/fs_enet/mii-fec.c')
-rw-r--r-- | drivers/net/fs_enet/mii-fec.c | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/drivers/net/fs_enet/mii-fec.c b/drivers/net/fs_enet/mii-fec.c index 61aaae444b40..75a09994d665 100644 --- a/drivers/net/fs_enet/mii-fec.c +++ b/drivers/net/fs_enet/mii-fec.c @@ -100,23 +100,6 @@ static int fs_enet_fec_mii_reset(struct mii_bus *bus) return 0; } -static void __devinit add_phy(struct mii_bus *bus, struct device_node *np) -{ - const u32 *data; - int len, id, irq; - - data = of_get_property(np, "reg", &len); - if (!data || len != 4) - return; - - id = *data; - bus->phy_mask &= ~(1 << id); - - irq = of_irq_to_resource(np, 0, NULL); - if (irq != NO_IRQ) - bus->irq[id] = irq; -} - static int __devinit fs_enet_mdio_probe(struct of_device *ofdev, const struct of_device_id *match) { @@ -163,17 +146,10 @@ static int __devinit fs_enet_mdio_probe(struct of_device *ofdev, if (!new_bus->irq) goto out_unmap_regs; - for (i = 0; i < PHY_MAX_ADDR; i++) - new_bus->irq[i] = -1; - - while ((np = of_get_next_child(ofdev->node, np))) - if (!strcmp(np->type, "ethernet-phy")) - add_phy(new_bus, np); - new_bus->parent = &ofdev->dev; dev_set_drvdata(&ofdev->dev, new_bus); - ret = mdiobus_register(new_bus); + ret = of_mdiobus_register(new_bus, ofdev->node); if (ret) goto out_free_irqs; |