Re: [PATCH net-next v9 2/4] net: phy: realtek: add RTL8224 pair order support
From: Damien Dejean
Date: Fri Mar 20 2026 - 14:18:35 EST
> Le 20 mars 2026 à 09:21, Simon Horman <horms@xxxxxxxxxx> a écrit :
>
> Checkpatch warns that ENOSYS only means 'invalid syscall nr'.
>
> Looking over the implementation of of_property_read_u32() it seems to me
> that -EINVAL is sufficient to detect that a property is not present. Which
> may be appropriate here.
I added the check on -ENOSYS because in v8 Jakub commented [1] on the fact
that if the kernel is built with CONFIG_OF=n, of_property_read_u32() will
return ENOSYS. If ENOSYS is not handled there, then the call will return an
error while it shouldn’t.
Damien
[1] https://lkml.org/lkml/2026/3/17/2464
>
> Likewise in patch 4/4.
>
> Using a quick grep of the tree, I do notice the same pattern as above is
> also present (only?) in aquantia_main.c. So depending on the outcome of this
> discussion it might be appropriate to update that too.
>
>> +
>> + if (ret)
>> + return ret;
>> +
>> + if (order & ~1)
>> + return -EINVAL;
>> +
>> + return rtl8224_package_modify_mmd(phydev, MDIO_MMD_VEND1,
>> + RTL8224_VND1_MDI_PAIR_SWAP,
>> + BIT(port_offset),
>> + order ? BIT(port_offset) : 0);
>> +}
>> +
>> +static int rtl8224_config_init(struct phy_device *phydev)
>> +{
>> + return rtl8224_mdi_config_order(phydev);
>> +}
>
> ...
>
>> @@ -2395,6 +2457,8 @@ static struct phy_driver realtek_drvs[] = {
>> PHY_ID_MATCH_EXACT(0x001ccad0),
>> .name = "RTL8224 2.5Gbps PHY",
>> .flags = PHY_POLL_CABLE_TEST,
>> + .probe = rtl8224_probe,
>> + .config_init = rtl8224_config_init,
>> .get_features = rtl822x_c45_get_features,
>> .config_aneg = rtl822x_c45_config_aneg,
>> .read_status = rtl822x_c45_read_status,
>> --
>> 2.47.3
>>