brcm63xx: switch to 3.9 kernel
[openwrt/staging/yousong.git] / target / linux / brcm63xx / patches-3.8 / 020-bcm63xx_enet-use-managed-memory-allocations.patch
1 From 451a609ca472f80838df056689359c5486d832c1 Mon Sep 17 00:00:00 2001
2 From: Jonas Gorski <jogo@openwrt.org>
3 Date: Sun, 10 Mar 2013 14:05:01 +0100
4 Subject: [PATCH 2/3] bcm63xx_enet: use managed memory allocations
5
6 Signed-off-by: Jonas Gorski <jogo@openwrt.org>
7 ---
8 drivers/net/ethernet/broadcom/bcm63xx_enet.c | 8 +++-----
9 1 file changed, 3 insertions(+), 5 deletions(-)
10
11 --- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
12 +++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
13 @@ -1728,7 +1728,8 @@ static int bcm_enet_probe(struct platfor
14 * if a slave is not present on hw */
15 bus->phy_mask = ~(1 << priv->phy_id);
16
17 - bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
18 + bus->irq = devm_kzalloc(&pdev->dev, sizeof(int) * PHY_MAX_ADDR,
19 + GFP_KERNEL);
20 if (!bus->irq) {
21 ret = -ENOMEM;
22 goto out_free_mdio;
23 @@ -1789,10 +1790,8 @@ static int bcm_enet_probe(struct platfor
24 return 0;
25
26 out_unregister_mdio:
27 - if (priv->mii_bus) {
28 + if (priv->mii_bus)
29 mdiobus_unregister(priv->mii_bus);
30 - kfree(priv->mii_bus->irq);
31 - }
32
33 out_free_mdio:
34 if (priv->mii_bus)
35 @@ -1833,7 +1832,6 @@ static int bcm_enet_remove(struct platfo
36
37 if (priv->has_phy) {
38 mdiobus_unregister(priv->mii_bus);
39 - kfree(priv->mii_bus->irq);
40 mdiobus_free(priv->mii_bus);
41 } else {
42 struct bcm63xx_enet_platform_data *pd;