1 From ce21b8fb255ebf0b49913fb4c62741d7eb05c6f6 Mon Sep 17 00:00:00 2001
2 From: Daniel Golle <daniel@makrotopia.org>
3 Date: Fri, 11 Oct 2024 22:28:43 +0100
4 Subject: [PATCH] net: phy: aquantia: fix return value check in
7 of_property_read_u32() returns -EINVAL in case the property cannot be
8 found rather than -ENOENT. Fix the check to not abort probing in case
9 of the property being missing, and also in case CONFIG_OF is not set
10 which will result in -ENOSYS.
12 Fixes: a2e1ba275eae ("net: phy: aquantia: allow forcing order of MDI pairs")
13 Reported-by: Jon Hunter <jonathanh@nvidia.com>
14 Closes: https://lore.kernel.org/all/114b4c03-5d16-42ed-945d-cf78eabea12b@nvidia.com/
15 Suggested-by: Hans-Frieder Vogt <hfdevel@gmx.net>
16 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
18 drivers/net/phy/aquantia/aquantia_main.c | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
21 --- a/drivers/net/phy/aquantia/aquantia_main.c
22 +++ b/drivers/net/phy/aquantia/aquantia_main.c
23 @@ -512,7 +512,7 @@ static int aqr107_config_mdi(struct phy_
24 ret = of_property_read_u32(np, "marvell,mdi-cfg-order", &mdi_conf);
26 /* Do nothing in case property "marvell,mdi-cfg-order" is not present */
28 + if (ret == -EINVAL || ret == -ENOSYS)