diff mbox series

[PATHv2,3/9] net/smc911x: fix return from smc911x_send

Message ID 20231225153929.8284-4-maxim.uvarov@linaro.org
State Superseded
Headers show
Series net fixes prior lwip | expand

Commit Message

Maxim Uvarov Dec. 25, 2023, 3:39 p.m. UTC
return value of smc911x_send is ignored, but on sucesseful
send we need return 0 and or error -ETIMEOUT, not opposite.

Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
---
 drivers/net/smc911x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass Dec. 26, 2023, 9:50 a.m. UTC | #1
On Mon, Dec 25, 2023 at 3:41 PM Maxim Uvarov <maxim.uvarov@linaro.org> wrote:
>
> return value of smc911x_send is ignored, but on sucesseful
> send we need return 0 and or error -ETIMEOUT, not opposite.
>
> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
> Reviewed-by: Tom Rini <trini@konsulko.com>
> ---
>  drivers/net/smc911x.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 5c5ad8b84a..616b7ce174 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -403,7 +403,7 @@  static int smc911x_send(struct udevice *dev, void *packet, int length)
 
 	ret = smc911x_send_common(priv, packet, length);
 
-	return ret ? 0 : -ETIMEDOUT;
+	return ret ? -ETIMEDOUT : 0;
 }
 
 static int smc911x_recv(struct udevice *dev, int flags, uchar **packetp)