Re: [PATCH net-next v2] net: phy: realtek: support MDI swapping for RTL8226-CG

From: Paolo Abeni

Date: Tue Mar 31 2026 - 09:29:33 EST


On 3/27/26 8:32 PM, Jan Hoffmann wrote:
> +static int rtl8226_config_mdi_order(struct phy_device *phydev)
> +{
> + u32 order;
> + int ret;
> +
> + ret = of_property_read_u32(phydev->mdio.dev.of_node, "enet-phy-pair-order", &order);
> +
> + /* Property not present, nothing to do */
> + if (ret == -EINVAL || ret == -ENOSYS)
> + return 0;
> +
> + if (ret)
> + return ret;
> +
> + /* Only enabling MDI swapping is supported */
> + if (order != 1)
> + return -EINVAL;

I guess some existing setup may have "enet-phy-pair-order" == 0, and the
above will make them fail. I think you should just pass with no action
in such a case.

/P