Skip to content

Commit

Permalink
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git…
Browse files Browse the repository at this point in the history
…/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
  • Loading branch information
Linus Torvalds committed Apr 24, 2016
2 parents 4dfa573 + a6f4850 commit 913f201
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
2 changes: 2 additions & 0 deletions drivers/thermal/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ config MTK_THERMAL
tristate "Temperature sensor driver for mediatek SoCs"
depends on ARCH_MEDIATEK || COMPILE_TEST
depends on HAS_IOMEM
depends on NVMEM || NVMEM=n
depends on RESET_CONTROLLER
default y
help
Enable this option if you want to have support for thermal management
Expand Down
3 changes: 1 addition & 2 deletions drivers/thermal/mtk_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <linux/thermal.h>
#include <linux/reset.h>
#include <linux/types.h>
#include <linux/nvmem-consumer.h>

/* AUXADC Registers */
#define AUXADC_CON0_V 0x000
Expand Down Expand Up @@ -619,7 +618,7 @@ static struct platform_driver mtk_thermal_driver = {

module_platform_driver(mtk_thermal_driver);

MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de");
MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
MODULE_AUTHOR("Hanyi Wu <hanyi.wu@mediatek.com>");
MODULE_DESCRIPTION("Mediatek thermal driver");
MODULE_LICENSE("GPL v2");
4 changes: 2 additions & 2 deletions drivers/thermal/of-thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,8 +803,8 @@ static int thermal_of_populate_trip(struct device_node *np,
* otherwise, it returns a corresponding ERR_PTR(). Caller must
* check the return value with help of IS_ERR() helper.
*/
static struct __thermal_zone *
thermal_of_build_thermal_zone(struct device_node *np)
static struct __thermal_zone
__init *thermal_of_build_thermal_zone(struct device_node *np)
{
struct device_node *child = NULL, *gchild;
struct __thermal_zone *tz;
Expand Down
2 changes: 1 addition & 1 deletion drivers/thermal/power_allocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ static void divvy_up_power(u32 *req_power, u32 *max_power, int num_actors,
capped_extra_power = 0;
extra_power = 0;
for (i = 0; i < num_actors; i++) {
u64 req_range = req_power[i] * power_range;
u64 req_range = (u64)req_power[i] * power_range;

granted_power[i] = DIV_ROUND_CLOSEST_ULL(req_range,
total_req_power);
Expand Down
8 changes: 4 additions & 4 deletions drivers/thermal/thermal_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,15 +688,15 @@ trip_point_temp_store(struct device *dev, struct device_attribute *attr,
{
struct thermal_zone_device *tz = to_thermal_zone(dev);
int trip, ret;
unsigned long temperature;
int temperature;

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

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

if (kstrtoul(buf, 10, &temperature))
if (kstrtoint(buf, 10, &temperature))
return -EINVAL;

ret = tz->ops->set_trip_temp(tz, trip, temperature);
Expand Down Expand Up @@ -899,9 +899,9 @@ emul_temp_store(struct device *dev, struct device_attribute *attr,
{
struct thermal_zone_device *tz = to_thermal_zone(dev);
int ret = 0;
unsigned long temperature;
int temperature;

if (kstrtoul(buf, 10, &temperature))
if (kstrtoint(buf, 10, &temperature))
return -EINVAL;

if (!tz->ops->set_emul_temp) {
Expand Down
4 changes: 2 additions & 2 deletions include/linux/thermal.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ struct thermal_zone_of_device_ops {

struct thermal_trip {
struct device_node *np;
unsigned long int temperature;
unsigned long int hysteresis;
int temperature;
int hysteresis;
enum thermal_trip_type type;
};

Expand Down

0 comments on commit 913f201

Please sign in to comment.