All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] net: mvneta: Switch to using devm_alloc_etherdev_mqs
@ 2019-04-23 20:46 Rosen Penev
  2019-04-24 18:52 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Rosen Penev @ 2019-04-23 20:46 UTC (permalink / raw)
  To: netdev

It allows some of the code to be simplified.

Tested on Turris Omnia.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/net/ethernet/marvell/mvneta.c | 12 ++++--------
 1 file 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 @@ static int mvneta_probe(struct platform_device *pdev)
 		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);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] net: mvneta: Switch to using devm_alloc_etherdev_mqs
  2019-04-23 20:46 [PATCH v2] net: mvneta: Switch to using devm_alloc_etherdev_mqs Rosen Penev
@ 2019-04-24 18:52 ` David Miller
  2019-04-24 23:14   ` Rosen Penev
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2019-04-24 18:52 UTC (permalink / raw)
  To: rosenp; +Cc: netdev

From: Rosen Penev <rosenp@gmail.com>
Date: Tue, 23 Apr 2019 13:46:03 -0700

> It allows some of the code to be simplified.
> 
> Tested on Turris Omnia.
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>

This is just a cleanup/simplification, so applied to net-next.

Please properly annotate your Subject lines in the future to indicate
the target tree your patch is for, for example in this case it should
have been:

	Subject: [PATCH net-next v2] ...

Thank you.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] net: mvneta: Switch to using devm_alloc_etherdev_mqs
  2019-04-24 18:52 ` David Miller
@ 2019-04-24 23:14   ` Rosen Penev
  0 siblings, 0 replies; 3+ messages in thread
From: Rosen Penev @ 2019-04-24 23:14 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

On Wed, Apr 24, 2019 at 11:52 AM David Miller <davem@davemloft.net> wrote:
>
> From: Rosen Penev <rosenp@gmail.com>
> Date: Tue, 23 Apr 2019 13:46:03 -0700
>
> > It allows some of the code to be simplified.
> >
> > Tested on Turris Omnia.
> >
> > Signed-off-by: Rosen Penev <rosenp@gmail.com>
>
> This is just a cleanup/simplification, so applied to net-next.
Thanks.
>
> Please properly annotate your Subject lines in the future to indicate
> the target tree your patch is for, for example in this case it should
> have been:
>
>         Subject: [PATCH net-next v2] ...
>
> Thank you.
Will do. I haven't sent any patches through here before this one. But
will keep in mind for the future.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-24 23:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-23 20:46 [PATCH v2] net: mvneta: Switch to using devm_alloc_etherdev_mqs Rosen Penev
2019-04-24 18:52 ` David Miller
2019-04-24 23:14   ` Rosen Penev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.