Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757333AbcCCKpa (ORCPT ); Thu, 3 Mar 2016 05:45:30 -0500 Received: from foss.arm.com ([217.140.101.70]:35814 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753360AbcCCKp2 (ORCPT ); Thu, 3 Mar 2016 05:45:28 -0500 Date: Thu, 3 Mar 2016 10:45:23 +0000 From: Javi Merino To: Leo Yan Cc: Wei Xu , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Catalin Marinas , Will Deacon , Zhang Rui , Eduardo Valentin , kongxinwei , Punit Agrawal , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [PATCH v2 1/5] thermal: change "hysteresis" as optional property Message-ID: <20160303104522.GA2907@e104805> References: <1456458227-12950-1-git-send-email-leo.yan@linaro.org> <1456458227-12950-2-git-send-email-leo.yan@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1456458227-12950-2-git-send-email-leo.yan@linaro.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2797 Lines: 77 On Fri, Feb 26, 2016 at 11:43:43AM +0800, Leo Yan wrote: > The property "hysteresis" is mandatory for trip points, so if without > it the thermal zone cannot register successfully. But "hysteresis" is > ignored in the thermal subsystem and only inquired by several thermal > sensor drivers. > > So change "hysteresis" as optional properties. I had forgotten that hysteresis is enforced in DT. Thanks for fixing this! > Signed-off-by: Leo Yan > --- > Documentation/devicetree/bindings/thermal/thermal.txt | 9 +++++---- > drivers/thermal/of-thermal.c | 9 ++++----- > 2 files changed, 9 insertions(+), 9 deletions(-) > > diff --git a/Documentation/devicetree/bindings/thermal/thermal.txt b/Documentation/devicetree/bindings/thermal/thermal.txt > index 41b817f..7d79e77 100644 > --- a/Documentation/devicetree/bindings/thermal/thermal.txt > +++ b/Documentation/devicetree/bindings/thermal/thermal.txt > @@ -89,10 +89,6 @@ Required properties: > Type: signed in millicelsius. > Size: one cell > > -- hysteresis: A low hysteresis value on temperature property (above). > - Type: unsigned This is a relative value, in millicelsius. > - Size: one cell > - > - type: a string containing the trip type. Expected values are: > "active": A trip point to enable active cooling > "passive": A trip point to enable passive cooling > @@ -100,6 +96,11 @@ Required properties: > "critical": Hardware not reliable. > Type: string > > +Optional properties: > +- hysteresis: A low hysteresis value on temperature property (above). > + Type: unsigned This is a relative value, in millicelsius. > + Size: one cell > + > * Cooling device maps > > The cooling device maps node is a node to describe how cooling devices > diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c > index 9043f8f..ab05500 100644 > --- a/drivers/thermal/of-thermal.c > +++ b/drivers/thermal/of-thermal.c > @@ -689,11 +689,10 @@ static int thermal_of_populate_trip(struct device_node *np, > trip->temperature = prop; > > ret = of_property_read_u32(np, "hysteresis", &prop); > - if (ret < 0) { > - pr_err("missing hysteresis property\n"); > - return ret; > - } > - trip->hysteresis = prop; > + if (ret < 0) > + pr_warning("missing hysteresis property\n"); I'd remove the warning. It is an optional parameter, so there is no need to warn about something going wrong. As you say in the commit log, it is ignored in the thermal subsystem and only used by some sensors so no need to warn about it missing. Other than that, I'm happy to see this merged. Acked-by: Javi Merino > + else > + trip->hysteresis = prop; > > ret = thermal_of_get_trip_type(np, &trip->type); > if (ret < 0) { > -- > 1.9.1 >