[PATCH net-next v11 2/5] net: ti: prueth: Adds ICSSM Ethernet driver

Markus Elfring Markus.Elfring at web.de
Tue Jul 22 08:36:50 PDT 2025


…
> +++ 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



More information about the linux-arm-kernel mailing list