Re: [PATCH net-next v1 3/9] net: dsa: qca: ar9331: reorder MDIO write sequence
From: Andrew Lunn
Date: Sat Apr 03 2021 - 10:56:03 EST
Hi Oleksij
Maybe add a short comment about why the order is important.
> - ret = __ar9331_mdio_write(sbus, AR9331_SW_MDIO_PHY_MODE_REG, reg, val);
> + ret = __ar9331_mdio_write(sbus, AR9331_SW_MDIO_PHY_MODE_REG, reg + 2,
> + val >> 16);
> if (ret < 0)
> goto error;
>
> - ret = __ar9331_mdio_write(sbus, AR9331_SW_MDIO_PHY_MODE_REG, reg + 2,
> - val >> 16);
> + ret = __ar9331_mdio_write(sbus, AR9331_SW_MDIO_PHY_MODE_REG, reg, val);
> if (ret < 0)
> goto error;
>
> return 0;
> +
> error:
> dev_err_ratelimited(&sbus->dev, "Bus error. Failed to write register.\n");
> return ret;
With that:
Reviewed-by: Andrew Lunn <andrew@xxxxxxx>
Andrew
> --
> 2.29.2
>