diff mbox series

[10/13] net: fec_mxc_init(): do not ignore return status of fec_open()

Message ID 4d8009789411a42fb860fcd00343c73d8fbe628c.1724846454.git.jerome.forissier@linaro.org
State Superseded
Headers show
Series Miscellaneous fixes | expand

Commit Message

Jerome Forissier Aug. 28, 2024, 12:10 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>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/net/fec_mxc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Ilias Apalodimas Aug. 29, 2024, 7:34 a.m. UTC | #1
On Wed, 28 Aug 2024 at 15:10, 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>
> ---
>  drivers/net/fec_mxc.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
> index 0a0d92bc2c..2dc1364bee 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);
>  }
>
>  /**
> --
> 2.40.1
>

Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
diff mbox series

Patch

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 0a0d92bc2c..2dc1364bee 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);
 }
 
 /**