diff mbox series

net: axi_emac: Change return value to -EAGAIN if RX is not ready

Message ID 20230719065337.69280-1-bigunclemax@gmail.com
State Accepted
Commit 3fb4ef7d39abbb2f8f6cd349e4af11082bf8c8c4
Delegated to: Andre Przywara
Headers show
Series net: axi_emac: Change return value to -EAGAIN if RX is not ready | expand

Commit Message

Maxim Kiselev July 19, 2023, 6:53 a.m. UTC
If there is no incoming package than axiemac_recv will return -1 which
in turn leads to printing `eth_rx: recv() returned error -1` error
message in eth_rx function. But missing a package is not an fatal error,
so return -EAGAIN in that case would be more suitable.

Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
---
 drivers/net/xilinx_axi_emac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michal Simek July 19, 2023, 1:54 p.m. UTC | #1
On 7/19/23 08:53, Maksim Kiselev wrote:
> If there is no incoming package than axiemac_recv will return -1 which
> in turn leads to printing `eth_rx: recv() returned error -1` error
> message in eth_rx function. But missing a package is not an fatal error,
> so return -EAGAIN in that case would be more suitable.
> 
> Signed-off-by: Maksim Kiselev <bigunclemax@gmail.com>
> ---
>   drivers/net/xilinx_axi_emac.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c
> index 3e9919993d..39cb3cc260 100644
> --- a/drivers/net/xilinx_axi_emac.c
> +++ b/drivers/net/xilinx_axi_emac.c
> @@ -748,7 +748,7 @@ static int axiemac_recv(struct udevice *dev, int flags, uchar **packetp)
>   
>   	/* Wait for an incoming packet */
>   	if (!isrxready(priv))
> -		return -1;
> +		return -EAGAIN;
>   
>   	debug("axiemac: RX data ready\n");
>   

Make sense. Applied.
M
diff mbox series

Patch

diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c
index 3e9919993d..39cb3cc260 100644
--- a/drivers/net/xilinx_axi_emac.c
+++ b/drivers/net/xilinx_axi_emac.c
@@ -748,7 +748,7 @@  static int axiemac_recv(struct udevice *dev, int flags, uchar **packetp)
 
 	/* Wait for an incoming packet */
 	if (!isrxready(priv))
-		return -1;
+		return -EAGAIN;
 
 	debug("axiemac: RX data ready\n");