[PATCH] clk: versal: Return error in case if clock setup failed

Michal Simek michal.simek at amd.com
Tue Jan 10 08:23:44 CET 2023


From: Jay Buddhabhatti <jay.buddhabhatti at xilinx.com>

Currently probe is getting success even if clock setup is failed
because of that u-boot is trying to access invalid clocks. So return
error if clock setup failed.

Signed-off-by: Jay Buddhabhatti <jay.buddhabhatti at xilinx.com>
Signed-off-by: Michal Simek <michal.simek at amd.com>
---

 drivers/clk/clk_versal.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk_versal.c b/drivers/clk/clk_versal.c
index 76fde00491b2..faebbab1c6d3 100644
--- a/drivers/clk/clk_versal.c
+++ b/drivers/clk/clk_versal.c
@@ -657,7 +657,9 @@ static int versal_clk_probe(struct udevice *dev)
 	if (ret < 0)
 		return -EINVAL;
 
-	versal_clock_setup();
+	ret = versal_clock_setup();
+	if (ret < 0)
+		return ret;
 
 	priv->clk = clock;
 
-- 
2.36.1



More information about the U-Boot mailing list