diff mbox series

[6/8] CLK: ARC: HSDK: make set_clock optional

Message ID 20200508124420.31788-7-Eugeniy.Paltsev@synopsys.com
State Accepted
Commit c6988688eefe985e4aca78488c424b9e09263da1
Headers show
Series CLK: ARC: HSDK: add separate clock map for HSDK-4xD | expand

Commit Message

Eugeniy Paltsev May 8, 2020, 12:44 p.m. UTC
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 at synopsys.com>
---
 drivers/clk/clk-hsdk-cgu.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/clk/clk-hsdk-cgu.c b/drivers/clk/clk-hsdk-cgu.c
index 6aba4587a44..dd665b13587 100644
--- a/drivers/clk/clk-hsdk-cgu.c
+++ b/drivers/clk/clk-hsdk-cgu.c
@@ -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)