diff options
| author | Cristian Marussi <cristian.marussi@arm.com> | 2026-05-08 18:32:50 +0300 |
|---|---|---|
| committer | Sudeep Holla <sudeep.holla@kernel.org> | 2026-05-12 17:29:11 +0300 |
| commit | cdcd2fc94936f78752e8e4829b1dc9962f0c2383 (patch) | |
| tree | 9f394f86d1738eddc125b1656f81f4a168c58431 | |
| parent | 0d76f62613cafecb7d326a5a45619024fa7e6e8e (diff) | |
| download | linux-cdcd2fc94936f78752e8e4829b1dc9962f0c2383.tar.xz | |
clk: scmi: Use new simplified per-clock rate properties
Use the new min_rate and max_rate unified properties that provide the
proper values without having to consider the clock type.
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20260508153300.2224715-6-cristian.marussi@arm.com
Reviewed-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Sudeep Holla <sudeep.holla@kernel.org>
| -rw-r--r-- | drivers/clk/clk-scmi.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/drivers/clk/clk-scmi.c b/drivers/clk/clk-scmi.c index c223e4ef1dd1..7c562559ad8b 100644 --- a/drivers/clk/clk-scmi.c +++ b/drivers/clk/clk-scmi.c @@ -202,7 +202,6 @@ static int scmi_clk_ops_init(struct device *dev, struct scmi_clk *sclk, const struct clk_ops *scmi_ops) { int ret; - unsigned long min_rate, max_rate; struct clk_init_data init = { .flags = CLK_GET_RATE_NOCACHE, @@ -217,20 +216,8 @@ static int scmi_clk_ops_init(struct device *dev, struct scmi_clk *sclk, if (ret) return ret; - if (sclk->info->rate_discrete) { - int num_rates = sclk->info->list.num_rates; - - if (num_rates <= 0) - return -EINVAL; - - min_rate = sclk->info->list.rates[0]; - max_rate = sclk->info->list.rates[num_rates - 1]; - } else { - min_rate = sclk->info->range.min_rate; - max_rate = sclk->info->range.max_rate; - } - - clk_hw_set_rate_range(&sclk->hw, min_rate, max_rate); + clk_hw_set_rate_range(&sclk->hw, sclk->info->min_rate, + sclk->info->max_rate); return ret; } |
