[PATCH] net: thunder_bgx: use OF loop instead of fwnode

Simon Horman horms at kernel.org
Mon Sep 1 08:23:52 PDT 2025


On Sat, Aug 30, 2025 at 02:42:17PM -0700, Rosen Penev wrote:
> The loop ends up converting fwnode to device_node anyway.
> 
> While at it, handle return value of of_get_mac_address in case of NVMEM.

I think that this part should be a separate patch.
Possibly targeted at net with a Fixes tag.

> 
> Simplify while loop iteration.
> 
> Signed-off-by: Rosen Penev <rosenp at gmail.com>

...

> @@ -1514,14 +1510,13 @@ static int bgx_init_of_phy(struct bgx *bgx)
>  	/* We are bailing out, try not to leak device reference counts
>  	 * for phy devices we may have already found.
>  	 */
> -	while (lmac) {
> +	while (lmac--) {
>  		if (bgx->lmac[lmac].phydev) {
>  			put_device(&bgx->lmac[lmac].phydev->mdio.dev);
>  			bgx->lmac[lmac].phydev = NULL;
>  		}
> -		lmac--;
>  	}

The update to this look looks correct to me, even without the rest of
the patch separate. If so, I'm wondering if it should also be a separate
patch. Again, possibly for net with a Fixes tag.

> -	of_node_put(node);
> +	of_node_put(child);
>  	return -EPROBE_DEFER;
>  }

...



More information about the linux-arm-kernel mailing list