summaryrefslogtreecommitdiff
path: root/drivers/hwmon/ltc4282.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/ltc4282.c')
-rw-r--r--drivers/hwmon/ltc4282.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/hwmon/ltc4282.c b/drivers/hwmon/ltc4282.c
index f607fe8f7937..dbb30abcd343 100644
--- a/drivers/hwmon/ltc4282.c
+++ b/drivers/hwmon/ltc4282.c
@@ -177,13 +177,15 @@ static const unsigned int ltc4282_out_rates[] = {
LTC4282_CLKOUT_CNV, LTC4282_CLKOUT_SYSTEM
};
-static long ltc4282_round_rate(struct clk_hw *hw, unsigned long rate,
- unsigned long *parent_rate)
+static int ltc4282_determine_rate(struct clk_hw *hw,
+ struct clk_rate_request *req)
{
- int idx = find_closest(rate, ltc4282_out_rates,
+ int idx = find_closest(req->rate, ltc4282_out_rates,
ARRAY_SIZE(ltc4282_out_rates));
- return ltc4282_out_rates[idx];
+ req->rate = ltc4282_out_rates[idx];
+
+ return 0;
}
static unsigned long ltc4282_recalc_rate(struct clk_hw *hw,
@@ -1124,7 +1126,7 @@ static ssize_t ltc4282_energy_show(struct device *dev,
static const struct clk_ops ltc4282_ops = {
.recalc_rate = ltc4282_recalc_rate,
- .round_rate = ltc4282_round_rate,
+ .determine_rate = ltc4282_determine_rate,
.set_rate = ltc4282_set_rate,
.disable = ltc4282_disable,
};
@@ -1596,7 +1598,7 @@ static const struct hwmon_ops ltc4282_hwmon_ops = {
.read_string = ltc4282_read_labels,
};
-static const struct hwmon_chip_info ltc2947_chip_info = {
+static const struct hwmon_chip_info ltc4282_chip_info = {
.ops = &ltc4282_hwmon_ops,
.info = ltc4282_info,
};
@@ -1717,7 +1719,7 @@ static int ltc4282_probe(struct i2c_client *i2c)
mutex_init(&st->lock);
hwmon = devm_hwmon_device_register_with_info(dev, "ltc4282", st,
- &ltc2947_chip_info,
+ &ltc4282_chip_info,
ltc4282_groups);
if (IS_ERR(hwmon))
return PTR_ERR(hwmon);