From mboxrd@z Thu Jan 1 00:00:00 1970 From: jonghwa3.lee@samsung.com Subject: Re: [PATCH 2/3] Thermal: core: Modify temp_crit_show() to use proper callback function. Date: Tue, 21 May 2013 10:31:52 +0900 Message-ID: <519ACE88.3090503@samsung.com> References: <1368870656-1183-1-git-send-email-jonghwa3.lee@samsung.com> <744357E9AAD1214791ACBA4B0B9092630110240D@SHSMSX101.ccr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mailout3.samsung.com ([203.254.224.33]:29937 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755853Ab3EUBb6 (ORCPT ); Mon, 20 May 2013 21:31:58 -0400 In-reply-to: <744357E9AAD1214791ACBA4B0B9092630110240D@SHSMSX101.ccr.corp.intel.com> Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: "Zhang, Rui" Cc: "linux-pm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Eduardo Valentin , Amit Dinel Kachhap , MyungJoo Ham On 2013=EB=85=84 05=EC=9B=94 21=EC=9D=BC 00:57, Zhang, Rui wrote: >=20 >=20 >> -----Original Message----- >> From: Jonghwa Lee [mailto:jonghwa3.lee@samsung.com] >> Sent: Saturday, May 18, 2013 5:51 PM >> To: linux-pm@vger.kernel.org >> Cc: linux-kernel@vger.kernel.org; Zhang, Rui; Eduardo Valentin; Amit >> Dinel Kachhap; Jonghwa Lee; MyungJoo Ham >> Subject: [PATCH 2/3] Thermal: core: Modify temp_crit_show() to use >> proper callback function. >> Importance: High >> >> This patch modifies temp_crit_show() which is used to create hwmon's >> sysfs node to use .get_crit_temp callback function of thermal zone >> device rather than .get_trip_temp. >> >> Signed-off-by: Jonghwa Lee >> Signed-off-by: MyungJoo Ham >=20 > The problem is that .get_crit_temp is optional for thermal drivers > that has a critical trip point. Actually, this is a interface for hwmon not generic thermal framework. = And when we create this node through the thermal_add_hwmon_sysfs(), we've alread= y checked whether call back function is available. So the problem won't happen. Thanks Jonghwa > At least we do not have such kind of check in thermal core. > Take rcar_thermal driver for example, > It supports critical trip point but it does not have .get_crit_type. >=20 > So I'd like to see a fix in rcar thermal driver and thermal core > for this issue, together with this patch. >=20 > Thanks, > rui >> --- >> drivers/thermal/thermal_core.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/thermal/thermal_core.c >> b/drivers/thermal/thermal_core.c index f753f48..ce4384a 100644 >> --- a/drivers/thermal/thermal_core.c >> +++ b/drivers/thermal/thermal_core.c >> @@ -924,7 +924,7 @@ temp_crit_show(struct device *dev, struct >> device_attribute *attr, >> long temperature; >> int ret; >> >> - ret =3D tz->ops->get_trip_temp(tz, 0, &temperature); >> + ret =3D tz->ops->get_crit_temp(tz, &temperature); >> if (ret) >> return ret; >> >> -- >> 1.7.9.5 >=20 >=20