Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 369758
b: refs/heads/master
c: d1bd9ac
h: refs/heads/master
v: v3
  • Loading branch information
Sebastian Siewior authored and David S. Miller committed Apr 25, 2013
1 parent 417de3d commit 4b3c537
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4bc21d4162366bb892dc1a4a92110c656e2622ca
refs/heads/master: d1bd9acfa3419dc9d5c32589b34a370ca6ae100e
23 changes: 16 additions & 7 deletions trunk/drivers/net/ethernet/ti/cpsw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,7 @@ static int cpsw_probe_dual_emac(struct platform_device *pdev,

static int cpsw_probe(struct platform_device *pdev)
{
struct cpsw_platform_data *data = pdev->dev.platform_data;
struct cpsw_platform_data *data;
struct net_device *ndev;
struct cpsw_priv *priv;
struct cpdma_params dma_params;
Expand Down Expand Up @@ -1845,7 +1845,7 @@ static int cpsw_probe(struct platform_device *pdev)
goto clean_ale_ret;
}
priv->irqs_table[k] = i;
priv->num_irqs = k;
priv->num_irqs = k + 1;
}
k++;
}
Expand Down Expand Up @@ -1883,7 +1883,8 @@ static int cpsw_probe(struct platform_device *pdev)
return 0;

clean_irq_ret:
free_irq(ndev->irq, priv);
for (i = 0; i < priv->num_irqs; i++)
free_irq(priv->irqs_table[i], priv);
clean_ale_ret:
cpsw_ale_destroy(priv->ale);
clean_dma_ret:
Expand All @@ -1906,20 +1907,26 @@ static int cpsw_probe(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
kfree(priv->slaves);
clean_ndev_ret:
free_netdev(ndev);
kfree(priv->data.slave_data);
free_netdev(priv->ndev);
return ret;
}

static int cpsw_remove(struct platform_device *pdev)
{
struct net_device *ndev = platform_get_drvdata(pdev);
struct cpsw_priv *priv = netdev_priv(ndev);
int i;

pr_info("removing device");
platform_set_drvdata(pdev, NULL);
if (priv->data.dual_emac)
unregister_netdev(cpsw_get_slave_ndev(priv, 1));
unregister_netdev(ndev);

cpts_unregister(priv->cpts);
free_irq(ndev->irq, priv);
for (i = 0; i < priv->num_irqs; i++)
free_irq(priv->irqs_table[i], priv);

cpsw_ale_destroy(priv->ale);
cpdma_chan_destroy(priv->txch);
cpdma_chan_destroy(priv->rxch);
Expand All @@ -1933,8 +1940,10 @@ static int cpsw_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
clk_put(priv->clk);
kfree(priv->slaves);
kfree(priv->data.slave_data);
if (priv->data.dual_emac)
free_netdev(cpsw_get_slave_ndev(priv, 1));
free_netdev(ndev);

return 0;
}

Expand Down

0 comments on commit 4b3c537

Please sign in to comment.