Re: [PATCH net-next v11 2/5] net: ti: prueth: Adds ICSSM Ethernet driver
From: Markus Elfring
Date: Tue Jul 22 2025 - 11:37:43 EST
…
> +++ b/drivers/net/ethernet/ti/icssm/icssm_prueth.c
> @@ -0,0 +1,609 @@
…
> +static int icssm_prueth_probe(struct platform_device *pdev)
> +{
…
> + /* register the network devices */
> + if (eth0_node) {
…
> + }
> +
> + if (eth1_node) {
…
> + }
> +
> + if (eth1_node)
> + of_node_put(eth1_node);
> + if (eth0_node)
> + of_node_put(eth0_node);
> + return 0;
…
I suggest to avoid duplicate condition checks for such a function implementation.
Can any code be reused from another function?
Regards,
Markus