Skip to content

Commit 826855f

Browse files
Daniel Lezcanodlezcano
authored andcommitted
regulator/drivers/max8976: Switch to new of thermal API
The thermal OF code has a new API allowing to migrate the OF initialization to a simpler approach. The ops are no longer device tree specific and are the generic ones provided by the core code. Convert the ops to the thermal_zone_device_ops format and use the new API to register the thermal zone with these generic ops. Signed-off-by: Daniel Lezcano <[email protected]> Acked-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]>
1 parent ad662b1 commit 826855f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/regulator/max8973-regulator.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -434,9 +434,9 @@ static int max8973_init_dcdc(struct max8973_chip *max,
434434
return ret;
435435
}
436436

437-
static int max8973_thermal_read_temp(void *data, int *temp)
437+
static int max8973_thermal_read_temp(struct thermal_zone_device *tz, int *temp)
438438
{
439-
struct max8973_chip *mchip = data;
439+
struct max8973_chip *mchip = tz->devdata;
440440
unsigned int val;
441441
int ret;
442442

@@ -465,7 +465,7 @@ static irqreturn_t max8973_thermal_irq(int irq, void *data)
465465
return IRQ_HANDLED;
466466
}
467467

468-
static const struct thermal_zone_of_device_ops max77621_tz_ops = {
468+
static const struct thermal_zone_device_ops max77621_tz_ops = {
469469
.get_temp = max8973_thermal_read_temp,
470470
};
471471

@@ -479,8 +479,8 @@ static int max8973_thermal_init(struct max8973_chip *mchip)
479479
if (mchip->id != MAX77621)
480480
return 0;
481481

482-
tzd = devm_thermal_zone_of_sensor_register(mchip->dev, 0, mchip,
483-
&max77621_tz_ops);
482+
tzd = devm_thermal_of_zone_register(mchip->dev, 0, mchip,
483+
&max77621_tz_ops);
484484
if (IS_ERR(tzd)) {
485485
ret = PTR_ERR(tzd);
486486
dev_err(mchip->dev, "Failed to register thermal sensor: %d\n",

0 commit comments

Comments
 (0)