Re: [PATCH net-next] net: phy: mxl-gpy: Add PHY Auto/MDI/MDI-X set driver for GPY211 chips

From: Andrew Lunn
Date: Fri Oct 21 2022 - 10:01:54 EST


> +static void gpy_update_mdix(struct phy_device *phydev)
> +{
> + int ret;
> +
> + ret = phy_read(phydev, PHY_CTL1);
> + if (ret < 0) {
> + phydev_err(phydev, "Error: MDIO register access failed: %d\n",
> + ret);
> + return;
> + }

> @@ -413,6 +490,8 @@ static void gpy_update_interface(struct phy_device *phydev)
>
> if (phydev->speed == SPEED_2500 || phydev->speed == SPEED_1000)
> genphy_read_master_slave(phydev);
> +
> + gpy_update_mdix(phydev);

Do you know why gpy_update_interface() is a void function? It is
called from gpy_read_status() which does return error codes. And it
seems like gpy_read_status() would benefit from returning -EINVAL, etc.

Andrew