[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <38279cb8-ff60-427e-ae9f-5f973955ffa6@web.de>
Date: Wed, 15 Nov 2023 10:10:36 +0100
From: Markus Elfring <Markus.Elfring@....de>
To: Florian Fainelli <florian.fainelli@...adcom.com>,
Justin Chen <justin.chen@...adcom.com>, Jakub Kicinski <kuba@...nel.org>,
Wojciech Drewek <wojciech.drewek@...el.com>,
Julia Lawall <Julia.Lawall@...ia.fr>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>, bcm-kernel-feedback-list@...adcom.com,
netdev@...r.kernel.org, kernel-janitors@...r.kernel.org
Cc: LKML <linux-kernel@...r.kernel.org>, cocci@...ia.fr,
Simon Horman <horms@...nel.org>
Subject: [PATCH v2] net: bcmasp: Use common error handling code in
bcmasp_probe()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Wed, 15 Nov 2023 09:38:56 +0100
Add a jump target so that a bit of exception handling can be better reused
in this function implementation.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
v2:
Special expectations were expressed for the previous patch size.
* Jakub Kicinski
https://lore.kernel.org/netdev/20231106145806.669875f4@kernel.org/
* Justin Chen
https://lore.kernel.org/netdev/CALSSxFYRgPwEq+QhCOYPqrtae8RvL=jTOcz4mk3vbe+Fc0QwbQ@mail.gmail.com/
* Florian Fainelli
https://lore.kernel.org/netdev/4053e838-e5cf-4450-8067-21bdec989d1b@broadcom.com/
Thus another change variant can eventually be integrated.
drivers/net/ethernet/broadcom/asp2/bcmasp.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/asp2/bcmasp.c b/drivers/net/ethernet/broadcom/asp2/bcmasp.c
index 29b04a274d07..7d6c15732d9f 100644
--- a/drivers/net/ethernet/broadcom/asp2/bcmasp.c
+++ b/drivers/net/ethernet/broadcom/asp2/bcmasp.c
@@ -1304,9 +1304,8 @@ static int bcmasp_probe(struct platform_device *pdev)
intf = bcmasp_interface_create(priv, intf_node, i);
if (!intf) {
dev_err(dev, "Cannot create eth interface %d\n", i);
- bcmasp_remove_intfs(priv);
of_node_put(intf_node);
- goto of_put_exit;
+ goto remove_intfs;
}
list_add_tail(&intf->list, &priv->intfs);
i++;
@@ -1331,6 +1330,7 @@ static int bcmasp_probe(struct platform_device *pdev)
netdev_err(intf->ndev,
"failed to register net_device: %d\n", ret);
priv->destroy_wol(priv);
+remove_intfs:
bcmasp_remove_intfs(priv);
goto of_put_exit;
}
--
2.42.1
Powered by blists - more mailing lists