Skip to content

Commit 76a5cfb

Browse files
committed
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal
Pull thermal fixes from Eduardo Valentin: "Fixes for STM and HISI thermal drivers" * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal: thermal: stm32: Fix stm_thermal_read_factory_settings thermal: stm32: read factory settings inside stm_thermal_prepare thermal/drivers/hisi: Fix number of sensors on hi3660 thermal/drivers/hisi: Fix wrong platform_get_irq_byname()
2 parents e10db79 + 99c47fc commit 76a5cfb

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

drivers/thermal/hisi_thermal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ static int hi3660_thermal_probe(struct hisi_thermal_data *data)
424424
struct platform_device *pdev = data->pdev;
425425
struct device *dev = &pdev->dev;
426426

427-
data->nr_sensors = 2;
427+
data->nr_sensors = 1;
428428

429429
data->sensor = devm_kzalloc(dev, sizeof(*data->sensor) *
430430
data->nr_sensors, GFP_KERNEL);
@@ -589,7 +589,7 @@ static int hisi_thermal_probe(struct platform_device *pdev)
589589
return ret;
590590
}
591591

592-
ret = platform_get_irq_byname(pdev, sensor->irq_name);
592+
ret = platform_get_irq(pdev, 0);
593593
if (ret < 0)
594594
return ret;
595595

drivers/thermal/st/stm_thermal.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ static int stm_thermal_read_factory_settings(struct stm_thermal_sensor *sensor)
241241
sensor->t0 = TS1_T0_VAL1;
242242

243243
/* Retrieve fmt0 and put it on Hz */
244-
sensor->fmt0 = ADJUST * readl_relaxed(sensor->base + DTS_T0VALR1_OFFSET)
245-
& TS1_FMT0_MASK;
244+
sensor->fmt0 = ADJUST * (readl_relaxed(sensor->base +
245+
DTS_T0VALR1_OFFSET) & TS1_FMT0_MASK);
246246

247247
/* Retrieve ramp coefficient */
248248
sensor->ramp_coeff = readl_relaxed(sensor->base + DTS_RAMPVALR_OFFSET) &
@@ -532,6 +532,10 @@ static int stm_thermal_prepare(struct stm_thermal_sensor *sensor)
532532
if (ret)
533533
return ret;
534534

535+
ret = stm_thermal_read_factory_settings(sensor);
536+
if (ret)
537+
goto thermal_unprepare;
538+
535539
ret = stm_thermal_calibration(sensor);
536540
if (ret)
537541
goto thermal_unprepare;
@@ -636,10 +640,6 @@ static int stm_thermal_probe(struct platform_device *pdev)
636640
/* Populate sensor */
637641
sensor->base = base;
638642

639-
ret = stm_thermal_read_factory_settings(sensor);
640-
if (ret)
641-
return ret;
642-
643643
sensor->clk = devm_clk_get(&pdev->dev, "pclk");
644644
if (IS_ERR(sensor->clk)) {
645645
dev_err(&pdev->dev, "%s: failed to fetch PCLK clock\n",

0 commit comments

Comments
 (0)