]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
clk: rockchip: check grf when waiting pll lock
authorShawn Lin <shawn.lin@rock-chips.com>
Mon, 15 Feb 2016 03:33:25 +0000 (11:33 +0800)
committerHeiko Stuebner <heiko@sntech.de>
Mon, 15 Feb 2016 21:38:27 +0000 (22:38 +0100)
rockchip_clk_get_grf pass on return value from
syscon_regmap_lookup_by_phandle, so we check grf to
make sure whether to do the following things or not.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
drivers/clk/rockchip/clk-pll.c

index b7e66c9dd9f2ebb84ccbfd6aac582e648c461baa..5de797e34d545881f87346f242acb71cb5769c23 100644 (file)
@@ -94,6 +94,11 @@ static int rockchip_pll_wait_lock(struct rockchip_clk_pll *pll)
        unsigned int val;
        int delay = 24000000, ret;
 
+       if (IS_ERR(grf)) {
+               pr_err("%s: grf regmap not available\n", __func__);
+               return PTR_ERR(grf);
+       }
+
        while (delay > 0) {
                ret = regmap_read(grf, pll->lock_offset, &val);
                if (ret) {