From: Ruan Jinjie <ruanjinjie@huawei.com>
To: <Shyam-sundar.S-k@amd.com>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<yisen.zhuang@huawei.com>, <salil.mehta@huawei.com>,
<iyappan@os.amperecomputing.com>, <keyur@os.amperecomputing.com>,
<quan@os.amperecomputing.com>, <andrew@lunn.ch>,
<hkallweit1@gmail.com>, <linux@armlinux.org.uk>,
<yankejian@huawei.com>, <netdev@vger.kernel.org>
Cc: <ruanjinjie@huawei.com>
Subject: [PATCH net-next 2/3] amd-xgbe: Return proper error code for get_phy_device()
Date: Thu, 17 Aug 2023 15:39:59 +0800 [thread overview]
Message-ID: <20230817074000.355564-3-ruanjinjie@huawei.com> (raw)
In-Reply-To: <20230817074000.355564-1-ruanjinjie@huawei.com>
get_phy_device() returns -EIO on bus access error and -ENOMEM
on kzalloc failure in addition to -ENODEV, just return -ENODEV is not
sensible, use PTR_ERR(phydev) to fix the issue.
Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
---
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
index 6a716337f48b..2f0a014ffc72 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c
@@ -1090,7 +1090,7 @@ static int xgbe_phy_find_phy_device(struct xgbe_prv_data *pdata)
(phy_data->phydev_mode == XGBE_MDIO_MODE_CL45));
if (IS_ERR(phydev)) {
netdev_err(pdata->netdev, "get_phy_device failed\n");
- return -ENODEV;
+ return PTR_ERR(phydev);
}
netif_dbg(pdata, drv, pdata->netdev, "external PHY id is %#010x\n",
phydev->phy_id);
--
2.34.1
next prev parent reply other threads:[~2023-08-17 7:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-17 7:39 [PATCH net-next 0/3] net: Fix return value check for get_phy_device() Ruan Jinjie
2023-08-17 7:39 ` [PATCH net-next 1/3] net: mdio: " Ruan Jinjie
2023-08-17 12:25 ` Andrew Lunn
2023-08-17 7:39 ` Ruan Jinjie [this message]
2023-08-17 8:09 ` [PATCH net-next 2/3] amd-xgbe: Return proper error code " Shyam Sundar S K
2023-08-17 12:28 ` Andrew Lunn
2023-08-17 12:54 ` Ruan Jinjie
2023-08-17 7:40 ` [PATCH net-next 3/3] net: hisilicon: hns: Fix return value check " Ruan Jinjie
2023-08-17 12:29 ` Andrew Lunn
2023-08-17 8:04 ` [PATCH net-next 0/3] net: " Leon Romanovsky
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=20230817074000.355564-3-ruanjinjie@huawei.com \
--to=ruanjinjie@huawei.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=iyappan@os.amperecomputing.com \
--cc=keyur@os.amperecomputing.com \
--cc=kuba@kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=quan@os.amperecomputing.com \
--cc=salil.mehta@huawei.com \
--cc=yankejian@huawei.com \
--cc=yisen.zhuang@huawei.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;
as well as URLs for NNTP newsgroup(s).