[PATCH 2/7] net: dwc_eth_qos: Return error code when start fails

Kever Yang kever.yang at rock-chips.com
Wed Sep 27 05:00:32 CEST 2023


On 2023/8/7 08:08, Jonas Karlman wrote:
> Return error code when phy_connect fails or no link can be established.
>
> Signed-off-by: Jonas Karlman <jonas at kwiboo.se>
Reviewed-by: Kever Yang <kever.yang at rock-chips.com>

Thanks,
- Kever
> ---
>   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;
>   	}
>   


More information about the U-Boot mailing list