[PATCH 1/2] ram: sifive: Check return value on clk_enable()
Bin Meng
bmeng.cn at gmail.com
Tue Sep 15 10:05:06 CEST 2020
From: Bin Meng <bin.meng at windriver.com>
The return value should be checked otherwise it's useless to
assign the return value to 'ret'.
Signed-off-by: Bin Meng <bin.meng at windriver.com>
---
drivers/ram/sifive/fu540_ddr.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/ram/sifive/fu540_ddr.c b/drivers/ram/sifive/fu540_ddr.c
index 5ff8869..f5b2873 100644
--- a/drivers/ram/sifive/fu540_ddr.c
+++ b/drivers/ram/sifive/fu540_ddr.c
@@ -369,6 +369,11 @@ static int fu540_ddr_probe(struct udevice *dev)
}
ret = clk_enable(&priv->ddr_clk);
+ if (ret < 0) {
+ debug("Could not enable DDR clock\n");
+ return ret;
+ }
+
priv->ctl = regmap_get_range(map, 0);
priv->phy = regmap_get_range(map, 1);
priv->physical_filter_ctrl = regmap_get_range(map, 2);
--
2.7.4
More information about the U-Boot
mailing list