Re: [PATCH net v2 3/5] net: dsa: vsc73xx: check busy flag in MDIO operations

From: Jakub Kicinski
Date: Wed Aug 07 2024 - 23:09:30 EST


On Mon, 5 Aug 2024 23:10:29 +0200 Pawel Dembicki wrote:
> - msleep(2);
> +
> + ret = vsc73xx_mdio_busy_check(vsc);
> + if (ret)
> + return ret;
> +
> ret = vsc73xx_read(vsc, VSC73XX_BLOCK_MII, 0, 2, &val);
> +
> if (ret)

nit: why the empty line between call and error check?

> return ret;
> if (val & BIT(16)) {
> @@ -561,7 +593,11 @@ static int vsc73xx_phy_write(struct dsa_switch *ds, int phy, int regnum,
> {
> struct vsc73xx *vsc = ds->priv;
> u32 cmd;
> - int ret;
> + int ret = 0;
> +
> + ret = vsc73xx_mdio_busy_check(vsc);

nit: why init ret to 0 ?