Messages in this thread |  | | From | Rosen Penev <> | | Date | Mon, 1 Sep 2025 14:23:17 -0700 | | Subject | Re: [PATCH] net: thunder_bgx: use OF loop instead of fwnode |
| |
On Mon, Sep 1, 2025 at 8:23 AM Simon Horman <horms@kernel.org> wrote: > > 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. I'll split up. > > > > > Simplify while loop iteration. > > > > Signed-off-by: Rosen Penev <rosenp@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. Maybe not. This can get called while lmac is 0, which is a u8. lmac-- like this will underflow. I'll send it as a separate patch from the upcoming series targeted at next. > > > - of_node_put(node); > > + of_node_put(child); > > return -EPROBE_DEFER; > > } > > ...
|  |