]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
ram: sifive: Check return value on clk_enable()
authorBin Meng <bin.meng@windriver.com>
Tue, 15 Sep 2020 08:05:06 +0000 (16:05 +0800)
committerAndes <uboot@andestech.com>
Wed, 30 Sep 2020 00:54:38 +0000 (08:54 +0800)
The return value should be checked otherwise it's useless to
assign the return value to 'ret'.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
drivers/ram/sifive/fu540_ddr.c

index 5ff88692a813978e9deff76d12e8ce089bac725d..f5b2873b33c189bb108f72cabb3b96624d1ec155 100644 (file)
@@ -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);