This patch changes the behavior of omap thermal zone so that if the data structures are not setup, it will always return 'disabled' while if data structures are set, then it will return the actual state.
Signed-off-by: Eduardo Valentin eduardo.valentin@ti.com --- drivers/thermal/omap_thermal.c | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/thermal/omap_thermal.c b/drivers/thermal/omap_thermal.c index cd5baa5..2d0fbc2 100644 --- a/drivers/thermal/omap_thermal.c +++ b/drivers/thermal/omap_thermal.c @@ -14,11 +14,13 @@ static int omap_get_mode(struct thermal_zone_device *thermal, { struct omap_thermal_zone *th_zone = thermal->devdata;
- if (th_zone->sensor_conf) { + if (!th_zone->sensor_conf) { pr_info("Temperature sensor not initialised\n"); *mode = THERMAL_DEVICE_DISABLED; - } else - *mode = THERMAL_DEVICE_ENABLED; + } else { + *mode = th_zone->mode; + } + return 0; }