Re: [PATCH net-next v2 2/3] net: phy: mscc: Consolidate probe functions into a common helper
From: Lad, Prabhakar
Date: Tue Nov 11 2025 - 03:51:10 EST
Hi Andrew,
Thank you for the review.
On Tue, Nov 11, 2025 at 2:50 AM Andrew Lunn <andrew@xxxxxxx> wrote:
>
> diff(1) has not made this easy...
>
I agree, --diff-algorithm=patience option for format-patch gives a
better result. I'll send a v3 with this option.
> > +static int vsc85xx_probe_common(struct phy_device *phydev,
> > + const struct vsc85xx_probe_config *cfg,
> > + const u32 *default_led_mode)
> > + int ret;
>
> > + /* Check rate magic if needed (only for non-package PHYs) */
> > + if (cfg->check_rate_magic) {
> > + ret = vsc85xx_edge_rate_magic_get(phydev);
> > + if (ret < 0)
> > + return ret;
> > + }
> >
> > vsc8531 = devm_kzalloc(&phydev->mdio.dev, sizeof(*vsc8531), GFP_KERNEL);
> > if (!vsc8531)
> > return -ENOMEM;
>
> > + /* Store rate magic if it was checked */
> > + if (cfg->check_rate_magic)
> > + vsc8531->rate_magic = ret;
>
>
> I think we end up with something like the above?
>
> I would move the vsc85xx_edge_rate_magic_get() after kzalloc() just to
> keep it all together.
>
Ok, I will group that under single if.
Cheers,
Prabhakar