Skip to content

Commit 49c7db1

Browse files
committed
Merge back earlier thermal core updates for 7.1
2 parents 9e07e3b + 9454714 commit 49c7db1

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

drivers/thermal/devfreq_cooling.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,8 @@ of_devfreq_cooling_register_power(struct device_node *np, struct devfreq *df,
472472
remove_qos_req:
473473
dev_pm_qos_remove_request(&dfc->req_max_freq);
474474
free_table:
475-
kfree(dfc->freq_table);
475+
if (!dfc->em_pd)
476+
kfree(dfc->freq_table);
476477
free_dfc:
477478
kfree(dfc);
478479

drivers/thermal/thermal_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ static int thermal_bind_cdev_to_trip(struct thermal_zone_device *tz,
863863
goto free_mem;
864864

865865
dev->id = result;
866-
sprintf(dev->name, "cdev%d", dev->id);
866+
snprintf(dev->name, sizeof(dev->name), "cdev%d", dev->id);
867867
result =
868868
sysfs_create_link(&tz->device.kobj, &cdev->device.kobj, dev->name);
869869
if (result)

drivers/thermal/thermal_sysfs.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/err.h>
1919
#include <linux/slab.h>
2020
#include <linux/string.h>
21+
#include <linux/string_choices.h>
2122
#include <linux/jiffies.h>
2223

2324
#include "thermal_core.h"
@@ -56,10 +57,8 @@ mode_show(struct device *dev, struct device_attribute *attr, char *buf)
5657

5758
guard(thermal_zone)(tz);
5859

59-
if (tz->mode == THERMAL_DEVICE_ENABLED)
60-
return sysfs_emit(buf, "enabled\n");
61-
62-
return sysfs_emit(buf, "disabled\n");
60+
return sysfs_emit(buf, "%s\n",
61+
str_enabled_disabled(tz->mode == THERMAL_DEVICE_ENABLED));
6362
}
6463

6564
static ssize_t

0 commit comments

Comments
 (0)