From 96449581b3d57e3f1561cec82920a951664398b1 Mon Sep 17 00:00:00 2001 From: Claudiu Beznea Date: Tue, 19 Jan 2021 13:26:45 +0200 Subject: [PATCH] net: macb: check clk_set_rate return value to be negative clk_set_rate() returns the set rate in case of success and a negative number in case of failure. Consider failure only the negative numbers. Fixes: 3ef64444de157 ("dm: net: macb: Implement link speed change callback") Signed-off-by: Claudiu Beznea --- drivers/net/macb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 097d578710..80ed58d4b9 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -631,7 +631,7 @@ int __weak macb_linkspd_cb(struct udevice *dev, unsigned int speed) if (tx_clk.dev) { ret = clk_set_rate(&tx_clk, rate); - if (ret) + if (ret < 0) return ret; } #endif -- 2.39.5