Skip to content

Commit

Permalink
net: phy: aquantia: fix return value check in aqr107_config_mdi()
Browse files Browse the repository at this point in the history
of_property_read_u32() returns -EINVAL in case the property cannot be
found rather than -ENOENT. Fix the check to not abort probing in case
of the property being missing, and also in case CONFIG_OF is not set
which will result in -ENOSYS.

Fixes: a2e1ba2 ("net: phy: aquantia: allow forcing order of MDI pairs")
Reported-by: Jon Hunter <jonathanh@nvidia.com>
Closes: https://lore.kernel.org/all/114b4c03-5d16-42ed-945d-cf78eabea12b@nvidia.com/
Suggested-by: Hans-Frieder Vogt <hfdevel@gmx.net>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://patch.msgid.link/f8282e2fc6a5ac91fe91491edc7f1ca8f4a65a0d.1728825323.git.daniel@makrotopia.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Daniel Golle authored and Jakub Kicinski committed Oct 15, 2024
1 parent a581ed8 commit 57c28e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/phy/aquantia/aquantia_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ static int aqr107_config_mdi(struct phy_device *phydev)
ret = of_property_read_u32(np, "marvell,mdi-cfg-order", &mdi_conf);

/* Do nothing in case property "marvell,mdi-cfg-order" is not present */
if (ret == -ENOENT)
if (ret == -EINVAL || ret == -ENOSYS)
return 0;

if (ret)
Expand Down

0 comments on commit 57c28e9

Please sign in to comment.