media: i2c: ds90ub953: 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>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
Brian Masney 2025-10-16 12:16:26 -04:00 committed by Hans Verkuil
parent 17dc8ccd6d
commit 8a9f914e2e

View file

@ -1023,15 +1023,17 @@ static unsigned long ub953_clkout_recalc_rate(struct clk_hw *hw,
return rate;
}
static long ub953_clkout_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *parent_rate)
static int ub953_clkout_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req)
{
struct ub953_data *priv = container_of(hw, struct ub953_data, clkout_clk_hw);
struct ub953_clkout_data clkout_data;
ub953_calc_clkout_params(priv, rate, &clkout_data);
ub953_calc_clkout_params(priv, req->rate, &clkout_data);
return clkout_data.rate;
req->rate = clkout_data.rate;
return 0;
}
static int ub953_clkout_set_rate(struct clk_hw *hw, unsigned long rate,
@ -1050,7 +1052,7 @@ static int ub953_clkout_set_rate(struct clk_hw *hw, unsigned long rate,
static const struct clk_ops ub953_clkout_ops = {
.recalc_rate = ub953_clkout_recalc_rate,
.round_rate = ub953_clkout_round_rate,
.determine_rate = ub953_clkout_determine_rate,
.set_rate = ub953_clkout_set_rate,
};