net: fec_mxc_init(): do not ignore return status of fec_open()
authorJerome Forissier <jerome.forissier@linaro.org>
Wed, 11 Sep 2024 09:58:23 +0000 (11:58 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 24 Sep 2024 19:41:21 +0000 (13:41 -0600)
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>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
drivers/net/fec_mxc.c

index 0a0d92b..2dc1364 100644 (file)
@@ -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);
 }
 
 /**