Thermal: update thermal zone device after setting emul_temp
authorlan,Tianyu <tianyu.lan@intel.com>
Thu, 2 Jan 2014 07:47:54 +0000 (15:47 +0800)
committerZhang Rui <rui.zhang@intel.com>
Fri, 3 Jan 2014 14:54:20 +0000 (22:54 +0800)
This patch is to update thermal zone device after setting emul_temp
in order to make governor work according to input temperature immediately.

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
drivers/thermal/thermal_core.c

index 30a02add9e2eaa1e2c99f63e61aa3bcb378bec2b..45632bc05cc7f127cc5c72eb3769c35ac46c86d7 100644 (file)
@@ -777,6 +777,9 @@ emul_temp_store(struct device *dev, struct device_attribute *attr,
                ret = tz->ops->set_emul_temp(tz, temperature);
        }
 
+       if (!ret)
+               thermal_zone_device_update(tz);
+
        return ret ? ret : count;
 }
 static DEVICE_ATTR(emul_temp, S_IWUSR, NULL, emul_temp_store);