Skip to content

Commit be88fef

Browse files
committed
Merge tag 'thermal-v5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux
Pull thermal fixes from Daniel Lezcano: - Fix undefined temperature if negative on the rcar_gen3 (Dien Pham) - Fix wrong frequency converted from power for the cpufreq cooling device (Finley Xiao) - Fix compilation warnings by making functions static in the tsens driver (Amit Kucheria) - Fix return value of sprd_thm_probe for the Spreadtrum driver (Tiezhu Yang) - Fix bank number settings on the Mediatek mt8183 (Michael Kao) - Fix missing of_node_put() at probe time i.MX (Anson Huang) * tag 'thermal-v5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux: thermal/drivers/rcar_gen3: Fix undefined temperature if negative thermal/drivers/cpufreq_cooling: Fix wrong frequency converted from power thermal/drivers/tsens: Fix compilation warnings by making functions static thermal/drivers/sprd: Fix return value of sprd_thm_probe() thermal/drivers/mediatek: Fix bank number settings on mt8183 thermal/drivers: imx: Fix missing of_node_put() at probe time
2 parents 2cfa46d + 5f8f064 commit be88fef

File tree

6 files changed

+19
-15
lines changed

6 files changed

+19
-15
lines changed

drivers/thermal/cpufreq_cooling.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ static u32 cpu_power_to_freq(struct cpufreq_cooling_device *cpufreq_cdev,
123123
{
124124
int i;
125125

126-
for (i = cpufreq_cdev->max_level - 1; i >= 0; i--) {
127-
if (power > cpufreq_cdev->em->table[i].power)
126+
for (i = cpufreq_cdev->max_level; i >= 0; i--) {
127+
if (power >= cpufreq_cdev->em->table[i].power)
128128
break;
129129
}
130130

131-
return cpufreq_cdev->em->table[i + 1].frequency;
131+
return cpufreq_cdev->em->table[i].frequency;
132132
}
133133

134134
/**

drivers/thermal/imx_thermal.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ MODULE_DEVICE_TABLE(of, of_imx_thermal_match);
649649
static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data)
650650
{
651651
struct device_node *np;
652-
int ret;
652+
int ret = 0;
653653

654654
data->policy = cpufreq_cpu_get(0);
655655
if (!data->policy) {
@@ -664,11 +664,12 @@ static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data)
664664
if (IS_ERR(data->cdev)) {
665665
ret = PTR_ERR(data->cdev);
666666
cpufreq_cpu_put(data->policy);
667-
return ret;
668667
}
669668
}
670669

671-
return 0;
670+
of_node_put(np);
671+
672+
return ret;
672673
}
673674

674675
static void imx_thermal_unregister_legacy_cooling(struct imx_thermal_data *data)

drivers/thermal/mtk_thermal.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,9 @@ enum {
211211
/* The total number of temperature sensors in the MT8183 */
212212
#define MT8183_NUM_SENSORS 6
213213

214+
/* The number of banks in the MT8183 */
215+
#define MT8183_NUM_ZONES 1
216+
214217
/* The number of sensing points per bank */
215218
#define MT8183_NUM_SENSORS_PER_ZONE 6
216219

@@ -497,7 +500,7 @@ static const struct mtk_thermal_data mt7622_thermal_data = {
497500
*/
498501
static const struct mtk_thermal_data mt8183_thermal_data = {
499502
.auxadc_channel = MT8183_TEMP_AUXADC_CHANNEL,
500-
.num_banks = MT8183_NUM_SENSORS_PER_ZONE,
503+
.num_banks = MT8183_NUM_ZONES,
501504
.num_sensors = MT8183_NUM_SENSORS,
502505
.vts_index = mt8183_vts_index,
503506
.cali_val = MT8183_CALIBRATION,

drivers/thermal/qcom/tsens.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ static inline u32 masked_irq(u32 hw_id, u32 mask, enum tsens_ver ver)
382382
*
383383
* Return: IRQ_HANDLED
384384
*/
385-
irqreturn_t tsens_critical_irq_thread(int irq, void *data)
385+
static irqreturn_t tsens_critical_irq_thread(int irq, void *data)
386386
{
387387
struct tsens_priv *priv = data;
388388
struct tsens_irq_data d;
@@ -452,7 +452,7 @@ irqreturn_t tsens_critical_irq_thread(int irq, void *data)
452452
*
453453
* Return: IRQ_HANDLED
454454
*/
455-
irqreturn_t tsens_irq_thread(int irq, void *data)
455+
static irqreturn_t tsens_irq_thread(int irq, void *data)
456456
{
457457
struct tsens_priv *priv = data;
458458
struct tsens_irq_data d;
@@ -520,7 +520,7 @@ irqreturn_t tsens_irq_thread(int irq, void *data)
520520
return IRQ_HANDLED;
521521
}
522522

523-
int tsens_set_trips(void *_sensor, int low, int high)
523+
static int tsens_set_trips(void *_sensor, int low, int high)
524524
{
525525
struct tsens_sensor *s = _sensor;
526526
struct tsens_priv *priv = s->priv;
@@ -557,7 +557,7 @@ int tsens_set_trips(void *_sensor, int low, int high)
557557
return 0;
558558
}
559559

560-
int tsens_enable_irq(struct tsens_priv *priv)
560+
static int tsens_enable_irq(struct tsens_priv *priv)
561561
{
562562
int ret;
563563
int val = tsens_version(priv) > VER_1_X ? 7 : 1;
@@ -570,7 +570,7 @@ int tsens_enable_irq(struct tsens_priv *priv)
570570
return ret;
571571
}
572572

573-
void tsens_disable_irq(struct tsens_priv *priv)
573+
static void tsens_disable_irq(struct tsens_priv *priv)
574574
{
575575
regmap_field_write(priv->rf[INT_EN], 0);
576576
}

drivers/thermal/rcar_gen3_thermal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static int rcar_gen3_thermal_get_temp(void *devdata, int *temp)
167167
{
168168
struct rcar_gen3_thermal_tsc *tsc = devdata;
169169
int mcelsius, val;
170-
u32 reg;
170+
int reg;
171171

172172
/* Read register and convert to mili Celsius */
173173
reg = rcar_gen3_thermal_read(tsc, REG_GEN3_TEMP) & CTEMP_MASK;

drivers/thermal/sprd_thermal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ static int sprd_thm_probe(struct platform_device *pdev)
348348

349349
thm->var_data = pdata;
350350
thm->base = devm_platform_ioremap_resource(pdev, 0);
351-
if (!thm->base)
352-
return -ENOMEM;
351+
if (IS_ERR(thm->base))
352+
return PTR_ERR(thm->base);
353353

354354
thm->nr_sensors = of_get_child_count(np);
355355
if (thm->nr_sensors == 0 || thm->nr_sensors > SPRD_THM_MAX_SENSOR) {

0 commit comments

Comments
 (0)