summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorJinyoung Park <jinyoungp@nvidia.com>2014-06-17 17:03:51 +0900
committerMandar Padmawar <mpadmawar@nvidia.com>2014-06-23 02:10:18 -0700
commit397ce28d1841853103bc028080dfb00656211b9e (patch)
tree24293d1be0e1bd323588624423d1fb2832ed3d6c /drivers/thermal
parentbce4b76d14e5bc53cf20d931c7ab1bd8cbbd7f69 (diff)
thermal: check tz device is registered
Checking thermal zone device whether it is registered or not. Bug 200011588 Change-Id: I377583f887d3dbe8258daa46d777daa6337b192f Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/424088 Reviewed-by: Seema Khowala <seemaj@nvidia.com> Tested-by: Seema Khowala <seemaj@nvidia.com> Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/thermal_core.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index b4d2c1eb616b..dc2481dfdc12 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -418,7 +418,8 @@ int thermal_zone_get_temp(struct thermal_zone_device *tz, long *temp)
enum thermal_trip_type type;
#endif
- if (!tz || IS_ERR(tz) || !tz->ops->get_temp)
+ if (!tz || IS_ERR(tz) || !tz->ops->get_temp ||
+ !device_is_registered(&tz->device))
goto exit;
mutex_lock(&tz->lock);
@@ -471,7 +472,7 @@ void thermal_zone_device_update(struct thermal_zone_device *tz)
{
int count;
- if (!tz->ops->get_temp)
+ if (!tz || !tz->ops->get_temp || !device_is_registered(&tz->device))
return;
update_temperature(tz);