Re: [PATCH net-next v2 2/3] net: phy: mscc: Consolidate probe functions into a common helper
From: Andrew Lunn
Date: Mon Nov 10 2025 - 21:50:35 EST
diff(1) has not made this easy...
> +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.
Andrew
---
pw-bot: cr