diff options
author | Jonas Gorski <jogo@openwrt.org> | 2013-03-10 03:57:48 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-10 16:57:01 -0400 |
commit | 2a80b5e1580cf6b2c534674080dc3fdf788b06b8 (patch) | |
tree | 7928641d3b281b46742bdf1bce7d44074d22885e /drivers/net/ethernet/broadcom/bcm63xx_enet.c | |
parent | 1c03da0522e91617fcadeb7dd596ee41f2b116b9 (diff) |
bcm63xx_enet: use managed memory allocations
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Acked-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bcm63xx_enet.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bcm63xx_enet.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c index 8256b55883e2..b45e5fd46df6 100644 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c @@ -1727,7 +1727,8 @@ static int bcm_enet_probe(struct platform_device *pdev) * if a slave is not present on hw */ bus->phy_mask = ~(1 << priv->phy_id); - bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL); + bus->irq = devm_kzalloc(&pdev->dev, sizeof(int) * PHY_MAX_ADDR, + GFP_KERNEL); if (!bus->irq) { ret = -ENOMEM; goto out_free_mdio; @@ -1788,10 +1789,8 @@ static int bcm_enet_probe(struct platform_device *pdev) return 0; out_unregister_mdio: - if (priv->mii_bus) { + if (priv->mii_bus) mdiobus_unregister(priv->mii_bus); - kfree(priv->mii_bus->irq); - } out_free_mdio: if (priv->mii_bus) @@ -1832,7 +1831,6 @@ static int bcm_enet_remove(struct platform_device *pdev) if (priv->has_phy) { mdiobus_unregister(priv->mii_bus); - kfree(priv->mii_bus->irq); mdiobus_free(priv->mii_bus); } else { struct bcm63xx_enet_platform_data *pd; |