Re: [PATCH v4 net-next 05/10] net: dsa: microchip: add DSA support for microchip lan937x

Andrew Lunn
2021-10-07T21:59:00Z

> +static int lan937x_sw_mdio_read(struct mii_bus *bus, int addr, int regnum)
> +{
> + struct ksz_device *dev = bus->priv;
> + u16 val;
> + int ret;
> +

It would be good to check for C45 regnum values and return -EOPNOTSUPP.

> + ret = lan937x_internal_phy_read(dev, addr, regnum, &val);
> + if (ret < 0)
> + return ret;
> +
> + return val;
> +}
> +
> +static int lan937x_sw_mdio_write(struct mii_bus *bus, int addr, int regnum,
> + u16 val)
> +{
> + struct ksz_device *dev = bus->priv;
> +

Same here.

Andrew