public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] net: stmmac: dwmac-qcom-ethqos: Return device_get_phy_mode() errors properly
@ 2023-06-29 19:14 Andrew Halaney
  2023-06-29 19:14 ` [PATCH 2/3] net: stmmac: dwmac-qcom-ethqos: Use dev_err_probe() Andrew Halaney
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Andrew Halaney @ 2023-06-29 19:14 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arm-kernel, linux-stm32, netdev, mcoquelin.stm32, pabeni,
	kuba, edumazet, davem, joabreu, alexandre.torgue, peppe.cavallaro,
	bhupesh.sharma, vkoul, bartosz.golaszewski, Andrew Halaney

Other than -ENODEV, other errors resulted in -EINVAL being returned
instead of the actual error.

Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index e62940414e54..3bf025e8e2bd 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -721,6 +721,9 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	ethqos->phy_mode = device_get_phy_mode(dev);
+	if (ethqos->phy_mode < 0)
+		return dev_err_probe(dev, ethqos->phy_mode,
+				     "Failed to get phy mode\n");
 	switch (ethqos->phy_mode) {
 	case PHY_INTERFACE_MODE_RGMII:
 	case PHY_INTERFACE_MODE_RGMII_ID:
@@ -731,8 +734,6 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
 	case PHY_INTERFACE_MODE_SGMII:
 		ethqos->configure_func = ethqos_configure_sgmii;
 		break;
-	case -ENODEV:
-		return -ENODEV;
 	default:
 		return -EINVAL;
 	}
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-06-29 21:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-29 19:14 [PATCH 1/3] net: stmmac: dwmac-qcom-ethqos: Return device_get_phy_mode() errors properly Andrew Halaney
2023-06-29 19:14 ` [PATCH 2/3] net: stmmac: dwmac-qcom-ethqos: Use dev_err_probe() Andrew Halaney
2023-06-29 20:29   ` Andrew Lunn
2023-06-29 19:14 ` [PATCH 3/3] net: stmmac: dwmac-qcom-ethqos: Log more errors in probe Andrew Halaney
2023-06-29 20:32   ` Andrew Lunn
2023-06-29 21:10     ` Andrew Halaney
2023-06-29 19:39 ` [PATCH 1/3] net: stmmac: dwmac-qcom-ethqos: Return device_get_phy_mode() errors properly Simon Horman
2023-06-29 20:28 ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox