Skip to content

Commit

Permalink
thermal: of: Enable thermal_zoneX when sensor is correctly added
Browse files Browse the repository at this point in the history
Up till now the thermal_zone mode was by default "disabled". With this
patch the default behavior was changed to "enable".

One can read the mode at:
/sys/class/thermal/thermal_zone0/mode

Tested-by: Javi Merino <javi.merino@arm.com>
Reported-by: Abhilash Kesavan <a.kesavan@samsung.com>
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
  • Loading branch information
Lukasz Majewski authored and Eduardo Valentin committed Jan 21, 2015
1 parent b97f880 commit 528012c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/thermal/of-thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,9 @@ thermal_zone_of_sensor_register(struct device *dev, int sensor_id, void *data,
if (sensor_specs.np == sensor_np && id == sensor_id) {
tzd = thermal_zone_of_add_sensor(child, sensor_np,
data, ops);
if (!IS_ERR(tzd))
tzd->ops->set_mode(tzd, THERMAL_DEVICE_ENABLED);

of_node_put(sensor_specs.np);
of_node_put(child);
goto exit;
Expand Down

0 comments on commit 528012c

Please sign in to comment.