]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
CLK: ARC: HSDK: make set_clock optional
authorEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Thu, 7 May 2020 17:18:41 +0000 (20:18 +0300)
committerAlexey Brodkin <abrodkin@synopsys.com>
Wed, 13 May 2020 15:09:26 +0000 (18:09 +0300)
We don't want to allow change some clocks, i.e. DDR clock.
So allow to have set_clock to be unset in clock map.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
drivers/clk/clk-hsdk-cgu.c

index 6aba4587a4409f85adae9427bf8ab6fa8572088c..dd665b13587777c1c671d7ff5a169fee384dbaaf 100644 (file)
@@ -662,7 +662,10 @@ static ulong hsdk_cgu_set_rate(struct clk *sclk, ulong rate)
        if (hsdk_prepare_clock_tree_branch(sclk))
                return -EINVAL;
 
-       return clk->map[sclk->id].set_rate(sclk, rate);
+       if (clk->map[sclk->id].set_rate)
+               return clk->map[sclk->id].set_rate(sclk, rate);
+
+       return -ENOTSUPP;
 }
 
 static int hsdk_cgu_disable(struct clk *sclk)