diff mbox series

[v8,06/23] net: fec_mxc_init(): do not ignore return status of fec_open()

Message ID 38486335f3ec7990124f0224108a967641f7dca7.1723050310.git.jerome.forissier@linaro.org
State Superseded
Headers show
Series Introduce the lwIP network stack | expand

Commit Message

Jerome Forissier Aug. 7, 2024, 5:11 p.m. UTC
The fec_mxc_init() function currently always returns 0. This does not
allow the callers to detect when for instance the PHY initialization
failed due to the port being unconnected. Fix that by returning the
status of fec_open().

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
---
 drivers/net/fec_mxc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Fabio Estevam Aug. 7, 2024, 6:05 p.m. UTC | #1
On Wed, Aug 7, 2024 at 2:51 PM Jerome Forissier
<jerome.forissier@linaro.org> wrote:
>
> The fec_mxc_init() function currently always returns 0. This does not
> allow the callers to detect when for instance the PHY initialization
> failed due to the port being unconnected. Fix that by returning the
> status of fec_open().
>
> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>

Reviewed-by: Fabio Estevam <festevam@gmail.com>
Jerome Forissier Aug. 8, 2024, 1:01 p.m. UTC | #2
On 8/7/24 20:05, Fabio Estevam wrote:
> On Wed, Aug 7, 2024 at 2:51 PM Jerome Forissier
> <jerome.forissier@linaro.org> wrote:
>>
>> The fec_mxc_init() function currently always returns 0. This does not
>> allow the callers to detect when for instance the PHY initialization
>> failed due to the port being unconnected. Fix that by returning the
>> status of fec_open().
>>
>> Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
> 
> Reviewed-by: Fabio Estevam <festevam@gmail.com>

Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 0a0d92bc2cd..2dc1364beec 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -615,8 +615,7 @@  static int fecmxc_init(struct udevice *dev)
 	if (fec->xcv_type != SEVENWIRE)
 		miiphy_restart_aneg(dev);
 #endif
-	fec_open(dev);
-	return 0;
+	return fec_open(dev);
 }
 
 /**