From f8c9660bfe17100a27ca4cf28f957a25cb420255 Mon Sep 17 00:00:00 2001 From: Bin Meng Date: Tue, 15 Sep 2020 16:05:06 +0800 Subject: [PATCH] ram: sifive: Check return value on clk_enable() The return value should be checked otherwise it's useless to assign the return value to 'ret'. Signed-off-by: Bin Meng --- 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 5ff88692a8..f5b2873b33 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.39.5