On Sun, Oct 1, 2023 at 10:17 PM Jonas Karlman <jo...@kwiboo.se> wrote:
>
> Return error code when phy_connect fails or no link can be established.
>
> Signed-off-by: Jonas Karlman <jo...@kwiboo.se>
> Reviewed-by: Kever Yang <kever.y...@rock-chips.com>
> ---
> v2:
> - Collect r-b tag
>
> drivers/net/dwc_eth_qos.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/dwc_eth_qos.c b/drivers/net/dwc_eth_qos.c
> index 555eaee3bbc3..7565e716823a 100644
> --- a/drivers/net/dwc_eth_qos.c
> +++ b/drivers/net/dwc_eth_qos.c
> @@ -811,6 +811,7 @@ static int eqos_start(struct udevice *dev)
>
> if (!eqos->phy) {
> pr_err("phy_connect() failed");
> + ret = -ENODEV;
> goto err_stop_resets;
> }
>
> @@ -838,6 +839,7 @@ static int eqos_start(struct udevice *dev)
>
> if (!eqos->phy->link) {
> pr_err("No link");
> + ret = -EAGAIN;
> goto err_shutdown_phy;
> }
>
> --
> 2.42.0
>
Reviewed-by: Ramon Fried <rfried....@gmail.com>