aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal/of-thermal.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/of-thermal.c')
-rw-r--r--drivers/thermal/of-thermal.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c
index 4b2b999b7611..f8eb625b8400 100644
--- a/drivers/thermal/of-thermal.c
+++ b/drivers/thermal/of-thermal.c
@@ -401,6 +401,10 @@ thermal_zone_of_sensor_register(struct device *dev, int sensor_id,
401 struct of_phandle_args sensor_specs; 401 struct of_phandle_args sensor_specs;
402 int ret, id; 402 int ret, id;
403 403
404 /* Check whether child is enabled or not */
405 if (!of_device_is_available(child))
406 continue;
407
404 /* For now, thermal framework supports only 1 sensor per zone */ 408 /* For now, thermal framework supports only 1 sensor per zone */
405 ret = of_parse_phandle_with_args(child, "thermal-sensors", 409 ret = of_parse_phandle_with_args(child, "thermal-sensors",
406 "#thermal-sensor-cells", 410 "#thermal-sensor-cells",
@@ -771,6 +775,10 @@ int __init of_parse_thermal_zones(void)
771 struct thermal_zone_device *zone; 775 struct thermal_zone_device *zone;
772 struct thermal_zone_params *tzp; 776 struct thermal_zone_params *tzp;
773 777
778 /* Check whether child is enabled or not */
779 if (!of_device_is_available(child))
780 continue;
781
774 tz = thermal_of_build_thermal_zone(child); 782 tz = thermal_of_build_thermal_zone(child);
775 if (IS_ERR(tz)) { 783 if (IS_ERR(tz)) {
776 pr_err("failed to build thermal zone %s: %ld\n", 784 pr_err("failed to build thermal zone %s: %ld\n",
@@ -838,6 +846,10 @@ void of_thermal_destroy_zones(void)
838 for_each_child_of_node(np, child) { 846 for_each_child_of_node(np, child) {
839 struct thermal_zone_device *zone; 847 struct thermal_zone_device *zone;
840 848
849 /* Check whether child is enabled or not */
850 if (!of_device_is_available(child))
851 continue;
852
841 zone = thermal_zone_get_zone_by_name(child->name); 853 zone = thermal_zone_get_zone_by_name(child->name);
842 if (IS_ERR(zone)) 854 if (IS_ERR(zone))
843 continue; 855 continue;