Skip to content

Commit 9f4401a

Browse files
masneybgroeck
authored andcommitted
hwmon: (ltc4282) 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 appended to the "under-the-cut" portion of the patch. Signed-off-by: Brian Masney <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
1 parent 6082bfe commit 9f4401a

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/hwmon/ltc4282.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,15 @@ static const unsigned int ltc4282_out_rates[] = {
177177
LTC4282_CLKOUT_CNV, LTC4282_CLKOUT_SYSTEM
178178
};
179179

180-
static long ltc4282_round_rate(struct clk_hw *hw, unsigned long rate,
181-
unsigned long *parent_rate)
180+
static int ltc4282_determine_rate(struct clk_hw *hw,
181+
struct clk_rate_request *req)
182182
{
183-
int idx = find_closest(rate, ltc4282_out_rates,
183+
int idx = find_closest(req->rate, ltc4282_out_rates,
184184
ARRAY_SIZE(ltc4282_out_rates));
185185

186-
return ltc4282_out_rates[idx];
186+
req->rate = ltc4282_out_rates[idx];
187+
188+
return 0;
187189
}
188190

189191
static unsigned long ltc4282_recalc_rate(struct clk_hw *hw,
@@ -1124,7 +1126,7 @@ static ssize_t ltc4282_energy_show(struct device *dev,
11241126

11251127
static const struct clk_ops ltc4282_ops = {
11261128
.recalc_rate = ltc4282_recalc_rate,
1127-
.round_rate = ltc4282_round_rate,
1129+
.determine_rate = ltc4282_determine_rate,
11281130
.set_rate = ltc4282_set_rate,
11291131
.disable = ltc4282_disable,
11301132
};

0 commit comments

Comments
 (0)