From: Jonghwa Lee Date: Sat, 18 May 2013 09:50:26 +0000 (+0000) Subject: Thermal: core: Ask .get_trip_temp() to register thermal zone device. X-Git-Tag: submit/tizen/20141121.110247~2951 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a8469d2e6eb44a854a23292a15b8bbba4bc9f1f8;p=platform%2Fkernel%2Flinux-3.10.git Thermal: core: Ask .get_trip_temp() to register thermal zone device. 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 Signed-off-by: MyungJoo Ham Acked-by: Durgadoss R Signed-off-by: Zhang Rui --- diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 4ab8f38..cd9faa8 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1683,7 +1683,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);