Netdev List
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Eric Woudstra <ericwouds@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH net-next] net: phy: air_en8811h: fix some error codes
Date: Fri, 5 Apr 2024 13:08:59 +0300	[thread overview]
Message-ID: <7ef2e230-dfb7-4a77-8973-9e5be1a99fc2@moroto.mountain> (raw)

These error paths accidentally return "ret" which is zero/success
instead of the correct error code.

Fixes: 71e79430117d ("net: phy: air_en8811h: Add the Airoha EN8811H PHY driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/net/phy/air_en8811h.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/phy/air_en8811h.c b/drivers/net/phy/air_en8811h.c
index 720542a4fd82..4c9a1c9c805e 100644
--- a/drivers/net/phy/air_en8811h.c
+++ b/drivers/net/phy/air_en8811h.c
@@ -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;
@@ -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;
-- 
2.43.0


             reply	other threads:[~2024-04-05 10:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-05 10:08 Dan Carpenter [this message]
2024-04-08 16:37 ` [PATCH net-next] net: phy: air_en8811h: fix some error codes Simon Horman
2024-04-09  3:30 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7ef2e230-dfb7-4a77-8973-9e5be1a99fc2@moroto.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=ericwouds@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox