Skip to content

Commit 913f201

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: "Specifics in this pull request: - Fixes in mediatek and OF thermal drivers - Fixes in power_allocator governor - More fixes of unsigned to int type change in thermal_core.c. These change have been CI tested using KernelCI bot. \o/" * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal: thermal: fix Mediatek thermal controller build thermal: consistently use int for trip temp thermal: fix mtk_thermal build dependency thermal: minor mtk_thermal.c cleanups thermal: power_allocator: req_range multiplication should be a 64 bit type thermal: of: add __init attribute
2 parents 4dfa573 + a6f4850 commit 913f201

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

drivers/thermal/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,8 @@ config MTK_THERMAL
376376
tristate "Temperature sensor driver for mediatek SoCs"
377377
depends on ARCH_MEDIATEK || COMPILE_TEST
378378
depends on HAS_IOMEM
379+
depends on NVMEM || NVMEM=n
380+
depends on RESET_CONTROLLER
379381
default y
380382
help
381383
Enable this option if you want to have support for thermal management

drivers/thermal/mtk_thermal.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#include <linux/thermal.h>
2828
#include <linux/reset.h>
2929
#include <linux/types.h>
30-
#include <linux/nvmem-consumer.h>
3130

3231
/* AUXADC Registers */
3332
#define AUXADC_CON0_V 0x000
@@ -619,7 +618,7 @@ static struct platform_driver mtk_thermal_driver = {
619618

620619
module_platform_driver(mtk_thermal_driver);
621620

622-
MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de");
621+
MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
623622
MODULE_AUTHOR("Hanyi Wu <hanyi.wu@mediatek.com>");
624623
MODULE_DESCRIPTION("Mediatek thermal driver");
625624
MODULE_LICENSE("GPL v2");

drivers/thermal/of-thermal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -803,8 +803,8 @@ static int thermal_of_populate_trip(struct device_node *np,
803803
* otherwise, it returns a corresponding ERR_PTR(). Caller must
804804
* check the return value with help of IS_ERR() helper.
805805
*/
806-
static struct __thermal_zone *
807-
thermal_of_build_thermal_zone(struct device_node *np)
806+
static struct __thermal_zone
807+
__init *thermal_of_build_thermal_zone(struct device_node *np)
808808
{
809809
struct device_node *child = NULL, *gchild;
810810
struct __thermal_zone *tz;

drivers/thermal/power_allocator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ static void divvy_up_power(u32 *req_power, u32 *max_power, int num_actors,
301301
capped_extra_power = 0;
302302
extra_power = 0;
303303
for (i = 0; i < num_actors; i++) {
304-
u64 req_range = req_power[i] * power_range;
304+
u64 req_range = (u64)req_power[i] * power_range;
305305

306306
granted_power[i] = DIV_ROUND_CLOSEST_ULL(req_range,
307307
total_req_power);

drivers/thermal/thermal_core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -688,15 +688,15 @@ trip_point_temp_store(struct device *dev, struct device_attribute *attr,
688688
{
689689
struct thermal_zone_device *tz = to_thermal_zone(dev);
690690
int trip, ret;
691-
unsigned long temperature;
691+
int temperature;
692692

693693
if (!tz->ops->set_trip_temp)
694694
return -EPERM;
695695

696696
if (!sscanf(attr->attr.name, "trip_point_%d_temp", &trip))
697697
return -EINVAL;
698698

699-
if (kstrtoul(buf, 10, &temperature))
699+
if (kstrtoint(buf, 10, &temperature))
700700
return -EINVAL;
701701

702702
ret = tz->ops->set_trip_temp(tz, trip, temperature);
@@ -899,9 +899,9 @@ emul_temp_store(struct device *dev, struct device_attribute *attr,
899899
{
900900
struct thermal_zone_device *tz = to_thermal_zone(dev);
901901
int ret = 0;
902-
unsigned long temperature;
902+
int temperature;
903903

904-
if (kstrtoul(buf, 10, &temperature))
904+
if (kstrtoint(buf, 10, &temperature))
905905
return -EINVAL;
906906

907907
if (!tz->ops->set_emul_temp) {

include/linux/thermal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ struct thermal_zone_of_device_ops {
352352

353353
struct thermal_trip {
354354
struct device_node *np;
355-
unsigned long int temperature;
356-
unsigned long int hysteresis;
355+
int temperature;
356+
int hysteresis;
357357
enum thermal_trip_type type;
358358
};
359359

0 commit comments

Comments
 (0)