diff options
author | Rosen Penev <rosenp@gmail.com> | 2019-04-23 22:46:03 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-24 20:51:19 +0200 |
commit | a3ddd94f3efb3a9eda8ce7183f821a9c4fa3b47f (patch) | |
tree | 0ceb1bb8e691b33d1f9d820909acc7f36b8e8c57 /drivers/net/ethernet/marvell | |
parent | tipc: tipc_udp_recv() cleanup vs rcu verbs (diff) | |
download | linux-a3ddd94f3efb3a9eda8ce7183f821a9c4fa3b47f.tar.xz linux-a3ddd94f3efb3a9eda8ce7183f821a9c4fa3b47f.zip |
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: Rosen Penev <rosenp@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/marvell')
-rw-r--r-- | drivers/net/ethernet/marvell/mvneta.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index bb68737dce56..a715277ecf81 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -4476,15 +4476,14 @@ static int mvneta_probe(struct platform_device *pdev) int err; 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) return -ENOMEM; dev->irq = irq_of_parse_and_map(dn, 0); - if (dev->irq == 0) { - err = -EINVAL; - goto err_free_netdev; - } + if (dev->irq == 0) + return -EINVAL; phy_mode = of_get_phy_mode(dn); if (phy_mode < 0) { @@ -4705,8 +4704,6 @@ err_free_phylink: phylink_destroy(pp->phylink); err_free_irq: irq_dispose_mapping(dev->irq); -err_free_netdev: - free_netdev(dev); return err; } @@ -4723,7 +4720,6 @@ static int mvneta_remove(struct platform_device *pdev) free_percpu(pp->stats); irq_dispose_mapping(dev->irq); phylink_destroy(pp->phylink); - free_netdev(dev); if (pp->bm_priv) { mvneta_bm_pool_destroy(pp->bm_priv, pp->pool_long, 1 << pp->id); |