]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Thermal: core: Ask .get_trip_temp() to register thermal zone device.
authorJonghwa Lee <jonghwa3.lee@samsung.com>
Sat, 18 May 2013 09:50:26 +0000 (09:50 +0000)
committerZhang Rui <rui.zhang@intel.com>
Mon, 20 May 2013 16:01:55 +0000 (00:01 +0800)
This patch adds a requirement needing .get_trip_temp() callback
function for registering thermal zone device. This function is
used when thermal zone is updated and essential where thermal core
handles thermal trip based only polling way not hw interrupt.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Acked-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
drivers/thermal/thermal_core.c

index 1067fb0107b96e9ebb7e4e724440fa15813c6720..e56ded5984b5d6d2a5696cb0b38ecc2aa1e75df5 100644 (file)
@@ -1628,7 +1628,7 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
        if (!ops || !ops->get_temp)
                return ERR_PTR(-EINVAL);
 
-       if (trips > 0 && !ops->get_trip_type)
+       if (trips > 0 && (!ops->get_trip_type || !ops->get_trip_temp))
                return ERR_PTR(-EINVAL);
 
        tz = kzalloc(sizeof(struct thermal_zone_device), GFP_KERNEL);