netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rosen Penev <rosenp@gmail.com>
To: netdev@vger.kernel.org
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH net-next 06/11] net: gianfar: use devm_alloc_etherdev_mqs
Date: Mon,  2 Dec 2024 13:23:26 -0800	[thread overview]
Message-ID: <20241202212331.7238-7-rosenp@gmail.com> (raw)
In-Reply-To: <20241202212331.7238-1-rosenp@gmail.com>

There seems to be a mistake here. There's a num_rx_qs variable that is not
being passed to the allocation function. The mq variant just calls mqs
with the last parameter of the former duplicated to the last parameter
of the latter. That's fine if they match. Not sure they do.

Also avoids manual free_netdev

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
 drivers/net/ethernet/freescale/gianfar.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 435138f4699d..e486b77bc6f4 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -475,8 +475,6 @@ static void free_gfar_dev(struct gfar_private *priv)
 			kfree(priv->gfargrp[i].irqinfo[j]);
 			priv->gfargrp[i].irqinfo[j] = NULL;
 		}
-
-	free_netdev(priv->ndev);
 }
 
 static void disable_napi(struct gfar_private *priv)
@@ -681,7 +679,8 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev)
 		return -EINVAL;
 	}
 
-	*pdev = alloc_etherdev_mq(sizeof(*priv), num_tx_qs);
+	*pdev = devm_alloc_etherdev_mqs(&ofdev->dev, sizeof(*priv), num_tx_qs,
+					num_rx_qs);
 	dev = *pdev;
 	if (NULL == dev)
 		return -ENOMEM;
-- 
2.47.0


  parent reply	other threads:[~2024-12-02 21:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-02 21:23 [PATCH net-next 00/11] gianfar and mdio: modernize Rosen Penev
2024-12-02 21:23 ` [PATCH net-next 01/11] net: fsl_pq_mdio: use dev variable in _probe Rosen Penev
2024-12-02 21:23 ` [PATCH net-next 02/11] net: fsl_pq_mdio: use devm for mdiobus_alloc_size Rosen Penev
2024-12-02 21:23 ` [PATCH net-next 03/11] net: fsl_pq_mdio: use platform_get_resource Rosen Penev
2024-12-02 21:23 ` [PATCH net-next 04/11] net: fsl_pq_mdio: use devm for of_iomap Rosen Penev
2024-12-02 21:23 ` [PATCH net-next 05/11] net: fsl_pq_mdio: return directly in probe Rosen Penev
2024-12-02 21:23 ` Rosen Penev [this message]
2024-12-02 21:23 ` [PATCH net-next 07/11] net: gianfar: use devm for register_netdev Rosen Penev
2024-12-02 21:23 ` [PATCH net-next 08/11] net: gianfar: assign ofdev to priv struct Rosen Penev
2024-12-02 21:23 ` [PATCH net-next 09/11] net: gianfar: remove free_gfar_dev Rosen Penev
2024-12-02 21:23 ` [PATCH net-next 10/11] net: gianfar: alloc queues with devm Rosen Penev
2024-12-02 21:23 ` [PATCH net-next 11/11] net: gianfar: iomap " Rosen Penev
  -- strict thread matches above, loose matches on Subject: below --
2025-07-10 20:40 [PATCH net-next 00/11] gianfar and mdio: modernize Rosen Penev
2025-07-10 20:40 ` [PATCH net-next 06/11] net: gianfar: use devm_alloc_etherdev_mqs Rosen Penev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241202212331.7238-7-rosenp@gmail.com \
    --to=rosenp@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).