Commit a3ddd94f authored by Rosen Penev's avatar Rosen Penev Committed by David S. Miller

net: mvneta: Switch to using devm_alloc_etherdev_mqs

It allows some of the code to be simplified.

Tested on Turris Omnia.
Signed-off-by: default avatarRosen Penev <rosenp@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4109a2c3
...@@ -4476,15 +4476,14 @@ static int mvneta_probe(struct platform_device *pdev) ...@@ -4476,15 +4476,14 @@ static int mvneta_probe(struct platform_device *pdev)
int err; int err;
int cpu; int cpu;
dev = alloc_etherdev_mqs(sizeof(struct mvneta_port), txq_number, rxq_number); dev = devm_alloc_etherdev_mqs(&pdev->dev, sizeof(struct mvneta_port),
txq_number, rxq_number);
if (!dev) if (!dev)
return -ENOMEM; return -ENOMEM;
dev->irq = irq_of_parse_and_map(dn, 0); dev->irq = irq_of_parse_and_map(dn, 0);
if (dev->irq == 0) { if (dev->irq == 0)
err = -EINVAL; return -EINVAL;
goto err_free_netdev;
}
phy_mode = of_get_phy_mode(dn); phy_mode = of_get_phy_mode(dn);
if (phy_mode < 0) { if (phy_mode < 0) {
...@@ -4705,8 +4704,6 @@ static int mvneta_probe(struct platform_device *pdev) ...@@ -4705,8 +4704,6 @@ static int mvneta_probe(struct platform_device *pdev)
phylink_destroy(pp->phylink); phylink_destroy(pp->phylink);
err_free_irq: err_free_irq:
irq_dispose_mapping(dev->irq); irq_dispose_mapping(dev->irq);
err_free_netdev:
free_netdev(dev);
return err; return err;
} }
...@@ -4723,7 +4720,6 @@ static int mvneta_remove(struct platform_device *pdev) ...@@ -4723,7 +4720,6 @@ static int mvneta_remove(struct platform_device *pdev)
free_percpu(pp->stats); free_percpu(pp->stats);
irq_dispose_mapping(dev->irq); irq_dispose_mapping(dev->irq);
phylink_destroy(pp->phylink); phylink_destroy(pp->phylink);
free_netdev(dev);
if (pp->bm_priv) { if (pp->bm_priv) {
mvneta_bm_pool_destroy(pp->bm_priv, pp->pool_long, 1 << pp->id); mvneta_bm_pool_destroy(pp->bm_priv, pp->pool_long, 1 << pp->id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment