Skip to content

Commit

Permalink
net: phy: air_en8811h: fix some error codes
Browse files Browse the repository at this point in the history
These error paths accidentally return "ret" which is zero/success
instead of the correct error code.

Fixes: 71e7943 ("net: phy: air_en8811h: Add the Airoha EN8811H PHY driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
  • Loading branch information
Dan Carpenter authored and frank-w committed Apr 6, 2024
1 parent 683870a commit 8db176c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/phy/air_en8811h.c
Expand Up @@ -272,11 +272,11 @@ static int __air_buckpbus_reg_read(struct phy_device *phydev,

pbus_data_high = __phy_read(phydev, AIR_BPBUS_RD_DATA_HIGH);
if (pbus_data_high < 0)
return ret;
return pbus_data_high;

pbus_data_low = __phy_read(phydev, AIR_BPBUS_RD_DATA_LOW);
if (pbus_data_low < 0)
return ret;
return pbus_data_low;

*pbus_data = pbus_data_low | (pbus_data_high << 16);
return 0;
Expand Down Expand Up @@ -323,11 +323,11 @@ static int __air_buckpbus_reg_modify(struct phy_device *phydev,

pbus_data_high = __phy_read(phydev, AIR_BPBUS_RD_DATA_HIGH);
if (pbus_data_high < 0)
return ret;
return pbus_data_high;

pbus_data_low = __phy_read(phydev, AIR_BPBUS_RD_DATA_LOW);
if (pbus_data_low < 0)
return ret;
return pbus_data_low;

pbus_data_old = pbus_data_low | (pbus_data_high << 16);
pbus_data_new = (pbus_data_old & ~mask) | set;
Expand Down

0 comments on commit 8db176c

Please sign in to comment.