[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241001205844.306821-17-rosenp@gmail.com>
Date: Tue, 1 Oct 2024 13:58:42 -0700
From: Rosen Penev <rosenp@...il.com>
To: netdev@...r.kernel.org
Cc: andrew@...n.ch,
davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com,
linux-kernel@...r.kernel.org,
jacob.e.keller@...el.com,
horms@...nel.org,
sd@...asysnail.net,
chunkeey@...il.com
Subject: [PATCHv2 net-next 16/18] net: ibm: emac: mal: move alloc_netdev_dummy down
Removes a goto from the probe function.
Signed-off-by: Rosen Penev <rosenp@...il.com>
---
drivers/net/ethernet/ibm/emac/mal.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/ibm/emac/mal.c b/drivers/net/ethernet/ibm/emac/mal.c
index 3fae1f0ec020..71781c7f6dcf 100644
--- a/drivers/net/ethernet/ibm/emac/mal.c
+++ b/drivers/net/ethernet/ibm/emac/mal.c
@@ -582,15 +582,6 @@ static int mal_probe(struct platform_device *ofdev)
INIT_LIST_HEAD(&mal->list);
spin_lock_init(&mal->lock);
- mal->dummy_dev = alloc_netdev_dummy(0);
- if (!mal->dummy_dev) {
- err = -ENOMEM;
- goto fail_unmap;
- }
-
- netif_napi_add_weight(mal->dummy_dev, &mal->napi, mal_poll,
- CONFIG_IBM_EMAC_POLL_WEIGHT);
-
/* Load power-on reset defaults */
mal_reset(mal);
@@ -618,7 +609,7 @@ static int mal_probe(struct platform_device *ofdev)
GFP_KERNEL);
if (mal->bd_virt == NULL) {
err = -ENOMEM;
- goto fail_dummy;
+ goto fail_unmap;
}
for (i = 0; i < mal->num_tx_chans; ++i)
@@ -684,12 +675,19 @@ static int mal_probe(struct platform_device *ofdev)
wmb();
platform_set_drvdata(ofdev, mal);
+ mal->dummy_dev = alloc_netdev_dummy(0);
+ if (!mal->dummy_dev) {
+ err = -ENOMEM;
+ goto fail2;
+ }
+
+ netif_napi_add_weight(mal->dummy_dev, &mal->napi, mal_poll,
+ CONFIG_IBM_EMAC_POLL_WEIGHT);
+
return 0;
fail2:
dma_free_coherent(&ofdev->dev, bd_size, mal->bd_virt, mal->bd_dma);
- fail_dummy:
- free_netdev(mal->dummy_dev);
fail_unmap:
dcr_unmap(mal->dcr_host, 0x100);
return err;
--
2.46.2
Powered by blists - more mailing lists