mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
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>
This commit is contained in:
parent
0d76f62613
commit
cdcd2fc949
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user