diff options
author | Andrew Lunn <andrew@lunn.ch> | 2016-01-06 20:11:15 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-01-07 20:31:26 +0100 |
commit | e7f4dc3536a40097f95103ddf98dd55b3a980f5b (patch) | |
tree | 1b0498a5a9f306a92df28e1e2e632aa747383cd7 /drivers/net/phy/mdio-bcm-unimac.c | |
parent | phy: mdio-octeon: Use devm_mdiobus_alloc_size() (diff) | |
download | linux-e7f4dc3536a40097f95103ddf98dd55b3a980f5b.tar.xz linux-e7f4dc3536a40097f95103ddf98dd55b3a980f5b.zip |
mdio: Move allocation of interrupts into core
Have mdio_alloc() create the array of interrupt numbers, and
initialize it to POLLING. This is what most MDIO drivers want, so
allowing code to be removed from the drivers.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/mdio-bcm-unimac.c')
-rw-r--r-- | drivers/net/phy/mdio-bcm-unimac.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/net/phy/mdio-bcm-unimac.c b/drivers/net/phy/mdio-bcm-unimac.c index 4bde5e728fe0..8c73b2e771dd 100644 --- a/drivers/net/phy/mdio-bcm-unimac.c +++ b/drivers/net/phy/mdio-bcm-unimac.c @@ -200,16 +200,10 @@ static int unimac_mdio_probe(struct platform_device *pdev) bus->reset = unimac_mdio_reset; snprintf(bus->id, MII_BUS_ID_SIZE, "%s", pdev->name); - bus->irq = kcalloc(PHY_MAX_ADDR, sizeof(int), GFP_KERNEL); - if (!bus->irq) { - ret = -ENOMEM; - goto out_mdio_free; - } - ret = of_mdiobus_register(bus, np); if (ret) { dev_err(&pdev->dev, "MDIO bus registration failed\n"); - goto out_mdio_irq; + goto out_mdio_free; } platform_set_drvdata(pdev, priv); @@ -218,8 +212,6 @@ static int unimac_mdio_probe(struct platform_device *pdev) return 0; -out_mdio_irq: - kfree(bus->irq); out_mdio_free: mdiobus_free(bus); return ret; @@ -230,7 +222,6 @@ static int unimac_mdio_remove(struct platform_device *pdev) struct unimac_mdio_priv *priv = platform_get_drvdata(pdev); mdiobus_unregister(priv->mii_bus); - kfree(priv->mii_bus->irq); mdiobus_free(priv->mii_bus); return 0; |