diff options
author | Troy Kisky <troy.kisky@boundarydevices.com> | 2012-07-03 16:48:02 -0700 |
---|---|---|
committer | Troy Kisky <troy.kisky@boundarydevices.com> | 2012-07-03 16:48:02 -0700 |
commit | 37d87c18b131517e4f38593c816db4ce3efe5819 (patch) | |
tree | 9b4335aa55d2ec33d9013ca6ec08b4ec1480dd11 | |
parent | 8483b00ebf4d694e141954263e9151b0f2741ece (diff) |
fec: use phy_irq platform_data
-rw-r--r-- | drivers/net/fec.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 2078ef8d25f0..08ab0db522e5 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c @@ -874,7 +874,7 @@ static int fec_enet_mii_probe(struct net_device *ndev) return 0; } -static int fec_enet_mii_init(struct platform_device *pdev) +static int fec_enet_mii_init(struct platform_device *pdev, int phy_irq) { static struct mii_bus *fec0_mii_bus; struct net_device *ndev = platform_get_drvdata(pdev); @@ -940,7 +940,7 @@ static int fec_enet_mii_init(struct platform_device *pdev) } for (i = 0; i < PHY_MAX_ADDR; i++) - fep->mii_bus->irq[i] = PHY_POLL; + fep->mii_bus->irq[i] = phy_irq; if (mdiobus_register(fep->mii_bus)) goto err_out_free_mdio_irq; @@ -1525,6 +1525,7 @@ fec_probe(struct platform_device *pdev) struct net_device *ndev; int i, irq, ret = 0; struct resource *r; + int phy_irq = PHY_POLL; r = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!r) @@ -1557,8 +1558,11 @@ fec_probe(struct platform_device *pdev) platform_set_drvdata(pdev, ndev); pdata = pdev->dev.platform_data; - if (pdata) + if (pdata) { fep->phy_interface = pdata->phy; + if (pdata->phy_irq) + phy_irq = pdata->phy_irq; + } /* This device has up to three irqs on some platforms */ for (i = 0; i < 3; i++) { @@ -1586,7 +1590,7 @@ fec_probe(struct platform_device *pdev) if (ret) goto failed_init; - ret = fec_enet_mii_init(pdev); + ret = fec_enet_mii_init(pdev, phy_irq); if (ret) goto failed_mii_init; |