generic: 6.1, 6.6: replace Airoha EN8811H PHY driver with upstream
[openwrt/openwrt.git] / target / linux / generic / backport-6.1 / 799-v6.10-net-phy-air_en8811h-fix-some-error-codes.patch
1 From 87c33315af380ca12a2e59ac94edad4fe0481b4c Mon Sep 17 00:00:00 2001
2 From: Dan Carpenter <dan.carpenter@linaro.org>
3 Date: Fri, 5 Apr 2024 13:08:59 +0300
4 Subject: [PATCH] net: phy: air_en8811h: fix some error codes
5
6 These error paths accidentally return "ret" which is zero/success
7 instead of the correct error code.
8
9 Fixes: 71e79430117d ("net: phy: air_en8811h: Add the Airoha EN8811H PHY driver")
10 Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
11 Reviewed-by: Simon Horman <horms@kernel.org>
12 Link: https://lore.kernel.org/r/7ef2e230-dfb7-4a77-8973-9e5be1a99fc2@moroto.mountain
13 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
14 ---
15 drivers/net/phy/air_en8811h.c | 8 ++++----
16 1 file changed, 4 insertions(+), 4 deletions(-)
17
18 --- a/drivers/net/phy/air_en8811h.c
19 +++ b/drivers/net/phy/air_en8811h.c
20 @@ -272,11 +272,11 @@ static int __air_buckpbus_reg_read(struc
21
22 pbus_data_high = __phy_read(phydev, AIR_BPBUS_RD_DATA_HIGH);
23 if (pbus_data_high < 0)
24 - return ret;
25 + return pbus_data_high;
26
27 pbus_data_low = __phy_read(phydev, AIR_BPBUS_RD_DATA_LOW);
28 if (pbus_data_low < 0)
29 - return ret;
30 + return pbus_data_low;
31
32 *pbus_data = pbus_data_low | (pbus_data_high << 16);
33 return 0;
34 @@ -323,11 +323,11 @@ static int __air_buckpbus_reg_modify(str
35
36 pbus_data_high = __phy_read(phydev, AIR_BPBUS_RD_DATA_HIGH);
37 if (pbus_data_high < 0)
38 - return ret;
39 + return pbus_data_high;
40
41 pbus_data_low = __phy_read(phydev, AIR_BPBUS_RD_DATA_LOW);
42 if (pbus_data_low < 0)
43 - return ret;
44 + return pbus_data_low;
45
46 pbus_data_old = pbus_data_low | (pbus_data_high << 16);
47 pbus_data_new = (pbus_data_old & ~mask) | set;