Skip to content

Commit

Permalink
Merge tag 'thermal-v5.8-rc4' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/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
  • Loading branch information
Linus Torvalds committed Jun 29, 2020
2 parents 2cfa46d + 5f8f064 commit be88fef
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
6 changes: 3 additions & 3 deletions drivers/thermal/cpufreq_cooling.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,12 @@ static u32 cpu_power_to_freq(struct cpufreq_cooling_device *cpufreq_cdev,
{
int i;

for (i = cpufreq_cdev->max_level - 1; i >= 0; i--) {
if (power > cpufreq_cdev->em->table[i].power)
for (i = cpufreq_cdev->max_level; i >= 0; i--) {
if (power >= cpufreq_cdev->em->table[i].power)
break;
}

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

/**
Expand Down
7 changes: 4 additions & 3 deletions drivers/thermal/imx_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ MODULE_DEVICE_TABLE(of, of_imx_thermal_match);
static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data)
{
struct device_node *np;
int ret;
int ret = 0;

data->policy = cpufreq_cpu_get(0);
if (!data->policy) {
Expand All @@ -664,11 +664,12 @@ static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data)
if (IS_ERR(data->cdev)) {
ret = PTR_ERR(data->cdev);
cpufreq_cpu_put(data->policy);
return ret;
}
}

return 0;
of_node_put(np);

return ret;
}

static void imx_thermal_unregister_legacy_cooling(struct imx_thermal_data *data)
Expand Down
5 changes: 4 additions & 1 deletion drivers/thermal/mtk_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ enum {
/* The total number of temperature sensors in the MT8183 */
#define MT8183_NUM_SENSORS 6

/* The number of banks in the MT8183 */
#define MT8183_NUM_ZONES 1

/* The number of sensing points per bank */
#define MT8183_NUM_SENSORS_PER_ZONE 6

Expand Down Expand Up @@ -497,7 +500,7 @@ static const struct mtk_thermal_data mt7622_thermal_data = {
*/
static const struct mtk_thermal_data mt8183_thermal_data = {
.auxadc_channel = MT8183_TEMP_AUXADC_CHANNEL,
.num_banks = MT8183_NUM_SENSORS_PER_ZONE,
.num_banks = MT8183_NUM_ZONES,
.num_sensors = MT8183_NUM_SENSORS,
.vts_index = mt8183_vts_index,
.cali_val = MT8183_CALIBRATION,
Expand Down
10 changes: 5 additions & 5 deletions drivers/thermal/qcom/tsens.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ static inline u32 masked_irq(u32 hw_id, u32 mask, enum tsens_ver ver)
*
* Return: IRQ_HANDLED
*/
irqreturn_t tsens_critical_irq_thread(int irq, void *data)
static irqreturn_t tsens_critical_irq_thread(int irq, void *data)
{
struct tsens_priv *priv = data;
struct tsens_irq_data d;
Expand Down Expand Up @@ -452,7 +452,7 @@ irqreturn_t tsens_critical_irq_thread(int irq, void *data)
*
* Return: IRQ_HANDLED
*/
irqreturn_t tsens_irq_thread(int irq, void *data)
static irqreturn_t tsens_irq_thread(int irq, void *data)
{
struct tsens_priv *priv = data;
struct tsens_irq_data d;
Expand Down Expand Up @@ -520,7 +520,7 @@ irqreturn_t tsens_irq_thread(int irq, void *data)
return IRQ_HANDLED;
}

int tsens_set_trips(void *_sensor, int low, int high)
static int tsens_set_trips(void *_sensor, int low, int high)
{
struct tsens_sensor *s = _sensor;
struct tsens_priv *priv = s->priv;
Expand Down Expand Up @@ -557,7 +557,7 @@ int tsens_set_trips(void *_sensor, int low, int high)
return 0;
}

int tsens_enable_irq(struct tsens_priv *priv)
static int tsens_enable_irq(struct tsens_priv *priv)
{
int ret;
int val = tsens_version(priv) > VER_1_X ? 7 : 1;
Expand All @@ -570,7 +570,7 @@ int tsens_enable_irq(struct tsens_priv *priv)
return ret;
}

void tsens_disable_irq(struct tsens_priv *priv)
static void tsens_disable_irq(struct tsens_priv *priv)
{
regmap_field_write(priv->rf[INT_EN], 0);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/thermal/rcar_gen3_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static int rcar_gen3_thermal_get_temp(void *devdata, int *temp)
{
struct rcar_gen3_thermal_tsc *tsc = devdata;
int mcelsius, val;
u32 reg;
int reg;

/* Read register and convert to mili Celsius */
reg = rcar_gen3_thermal_read(tsc, REG_GEN3_TEMP) & CTEMP_MASK;
Expand Down
4 changes: 2 additions & 2 deletions drivers/thermal/sprd_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,8 +348,8 @@ static int sprd_thm_probe(struct platform_device *pdev)

thm->var_data = pdata;
thm->base = devm_platform_ioremap_resource(pdev, 0);
if (!thm->base)
return -ENOMEM;
if (IS_ERR(thm->base))
return PTR_ERR(thm->base);

thm->nr_sensors = of_get_child_count(np);
if (thm->nr_sensors == 0 || thm->nr_sensors > SPRD_THM_MAX_SENSOR) {
Expand Down

0 comments on commit be88fef

Please sign in to comment.