From: Bin Meng Date: Tue, 15 Sep 2020 08:05:06 +0000 (+0800) Subject: ram: sifive: Check return value on clk_enable() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=f8c9660bfe17100a27ca4cf28f957a25cb420255;p=u-boot.git 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 --- 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);