summaryrefslogtreecommitdiff
path: root/drivers/clk/ingenic/jz4780-cgu.c
diff options
context:
space:
mode:
authorBrian Masney <bmasney@redhat.com>2025-08-11 11:18:15 -0400
committerBrian Masney <bmasney@redhat.com>2025-09-08 09:41:27 -0400
commit2c52ae540c1f26ac7af86b7fa5a0789889436c2e (patch)
tree46b20f65507ff2fbcf8028f58ff0b0123faec48f /drivers/clk/ingenic/jz4780-cgu.c
parent93fc8a13df28fb59c3d0aeb8ba65bbd5a72dad0f (diff)
clk: ingenic: jz4780-cgu: convert from round_rate() to determine_rate()
The round_rate() clk ops is deprecated, so migrate this driver from round_rate() to determine_rate() using the Coccinelle semantic patch on the cover letter of this series. Signed-off-by: Brian Masney <bmasney@redhat.com>
Diffstat (limited to 'drivers/clk/ingenic/jz4780-cgu.c')
-rw-r--r--drivers/clk/ingenic/jz4780-cgu.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/clk/ingenic/jz4780-cgu.c b/drivers/clk/ingenic/jz4780-cgu.c
index b1dadc0a5e75..07e2f3c5c454 100644
--- a/drivers/clk/ingenic/jz4780-cgu.c
+++ b/drivers/clk/ingenic/jz4780-cgu.c
@@ -128,19 +128,19 @@ static unsigned long jz4780_otg_phy_recalc_rate(struct clk_hw *hw,
return parent_rate;
}
-static long jz4780_otg_phy_round_rate(struct clk_hw *hw, unsigned long req_rate,
- unsigned long *parent_rate)
+static int jz4780_otg_phy_determine_rate(struct clk_hw *hw,
+ struct clk_rate_request *req)
{
- if (req_rate < 15600000)
- return 12000000;
-
- if (req_rate < 21600000)
- return 19200000;
+ if (req->rate < 15600000)
+ req->rate = 12000000;
+ else if (req->rate < 21600000)
+ req->rate = 19200000;
+ else if (req->rate < 36000000)
+ req->rate = 24000000;
+ else
+ req->rate = 48000000;
- if (req_rate < 36000000)
- return 24000000;
-
- return 48000000;
+ return 0;
}
static int jz4780_otg_phy_set_rate(struct clk_hw *hw, unsigned long req_rate,
@@ -212,7 +212,7 @@ static int jz4780_otg_phy_is_enabled(struct clk_hw *hw)
static const struct clk_ops jz4780_otg_phy_ops = {
.recalc_rate = jz4780_otg_phy_recalc_rate,
- .round_rate = jz4780_otg_phy_round_rate,
+ .determine_rate = jz4780_otg_phy_determine_rate,
.set_rate = jz4780_otg_phy_set_rate,
.enable = jz4780_otg_phy_enable,