[U-Boot] clk: Fix error check in clk_set_default_parents()
diff mbox series

Message ID 20190926134242.26315-1-jjhiblot@ti.com
State Accepted
Commit 02e2a2ad2f01a5b88e3ff2b694de63c0b5c849f2
Delegated to: Lukasz Majewski
Headers show
  • [U-Boot] clk: Fix error check in clk_set_default_parents()
Related show

Commit Message

Jean-Jacques Hiblot Sept. 26, 2019, 1:42 p.m. UTC
According to the documentation in clk.h, clk_set_parent() return the new
rate of the clock or a negative error code.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
 drivers/clk/clk-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff mbox series

diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
index 64c181f4ad..bf1adc09ab 100644
--- a/drivers/clk/clk-uclass.c
+++ b/drivers/clk/clk-uclass.c
@@ -223,7 +223,7 @@  static int clk_set_default_parents(struct udevice *dev)
 		if (ret == -ENOSYS)
-		if (ret) {
+		if (ret < 0) {
 			debug("%s: failed to reparent clock %d for %s\n",
 			      __func__, index, dev_read_name(dev));
 			return ret;