U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Claudiu Beznea <claudiu.beznea@microchip.com>
To: u-boot@lists.denx.de
Subject: [PATCH 3/6] net: macb: check clk_set_rate return value to be negative
Date: Thu, 3 Dec 2020 11:25:53 +0200	[thread overview]
Message-ID: <1606987556-20217-4-git-send-email-claudiu.beznea@microchip.com> (raw)
In-Reply-To: <1606987556-20217-1-git-send-email-claudiu.beznea@microchip.com>

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 <claudiu.beznea@microchip.com>
---
 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 585d126a17f9..439d1706485c 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -564,7 +564,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.7.4

  parent reply	other threads:[~2020-12-03  9:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-03  9:25 [PATCH 0/6] add support for sama7g5 ethernet interfaces Claudiu Beznea
2020-12-03  9:25 ` [PATCH 1/6] net: macb: use dummy descriptor for RBQP Claudiu Beznea
2020-12-16  6:54   ` Eugen.Hristev at microchip.com
2020-12-16  7:17     ` Bin Meng
2020-12-16  8:29       ` Eugen.Hristev at microchip.com
2020-12-17  5:22     ` Padmarao.Begari at microchip.com
2021-01-14 11:19       ` Eugen.Hristev at microchip.com
2021-01-15  4:02         ` Padmarao Begari
2021-01-15  8:04           ` Eugen.Hristev at microchip.com
2021-01-15 12:26             ` Padmarao Begari
2021-01-15 12:42               ` Eugen.Hristev at microchip.com
2020-12-03  9:25 ` [PATCH 2/6] net: macb: add user io config data structure Claudiu Beznea
2020-12-03  9:25 ` Claudiu Beznea [this message]
2020-12-03  9:25 ` [PATCH 4/6] net: macb: add support for sama7g5 gmac Claudiu Beznea
2020-12-03  9:25 ` [PATCH 5/6] net: macb: add support for sama7g5 emac Claudiu Beznea
2020-12-03  9:25 ` [PATCH 6/6] net: macb: take into account all RGMII interface types Claudiu Beznea

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1606987556-20217-4-git-send-email-claudiu.beznea@microchip.com \
    --to=claudiu.beznea@microchip.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox