From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lukasz Majewski Subject: Re: [PATCH v2 1/4] thermal: of: Extend of-thermal.c to provide number of trip points Date: Wed, 26 Nov 2014 09:28:29 +0100 Message-ID: <20141126092829.41127e8b@amdc2363> References: <1412872737-624-1-git-send-email-l.majewski@samsung.com> <1416500488-7232-1-git-send-email-l.majewski@samsung.com> <1416500488-7232-2-git-send-email-l.majewski@samsung.com> <20141125060421.GA13591@developer> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mailout4.samsung.com ([203.254.224.34]:50877 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750834AbaKZI2m convert rfc822-to-8bit (ORCPT ); Wed, 26 Nov 2014 03:28:42 -0500 In-reply-to: <20141125060421.GA13591@developer> Sender: linux-pm-owner@vger.kernel.org List-Id: linux-pm@vger.kernel.org To: Eduardo Valentin Cc: Zhang Rui , Linux PM list , Thierry Reding , Bartlomiej Zolnierkiewicz , Lukasz Majewski , Mikko Perttunen , Stephen Warren , Abhilash Kesavan , Abhilash Kesavan , Guenter Roeck , linux-kernel@vger.kernel.org, Caesar Wang Hi Eduardo, >=20 > Lukasz, >=20 > On Thu, Nov 20, 2014 at 05:21:25PM +0100, Lukasz Majewski wrote: > > This patch extends the of-thermal.c to provide information about > > number of available trip points. > >=20 > > Signed-off-by: Lukasz Majewski > > --- > > Changes for v2: > > - Provide detailed (doxygen like) description of the > > of_thermal_get_ntrips() method > > - Check for data pointer not being NULL > > --- > > drivers/thermal/of-thermal.c | 20 ++++++++++++++++++++ > > drivers/thermal/thermal_core.h | 5 +++++ > > 2 files changed, 25 insertions(+) > >=20 > > diff --git a/drivers/thermal/of-thermal.c > > b/drivers/thermal/of-thermal.c index b7982f0..7170822 100644 > > --- a/drivers/thermal/of-thermal.c > > +++ b/drivers/thermal/of-thermal.c > > @@ -112,6 +112,26 @@ static int of_thermal_get_temp(struct > > thermal_zone_device *tz, return > > data->ops->get_temp(data->sensor_data, temp); } > > =20 > > +/** > > + * of_thermal_get_ntrips - function to export number of available > > trip > > + * points. > > + * @tz: pointer to a thermal zone > > + * > > + * This function is a globally visible wrapper to get number of > > trip points > > + * stored in the local struct __thermal_zone > > + * > > + * Return: number of available trip points, -ENODEV when data not > > available > > + */ > > +int of_thermal_get_ntrips(struct thermal_zone_device *tz) > > +{ > > + struct __thermal_zone *data =3D tz->devdata; > > + > > + if (!data || IS_ERR(data)) > > + return -ENODEV; > > + > > + return data->ntrips; > > +} > > + >=20 > Missing > EXPORT_SYMBOL_GPL(of_thermal_get_ntrips); OK >=20 > > static int of_thermal_get_trend(struct thermal_zone_device *tz, > > int trip, enum thermal_trend *trend) > > { > > diff --git a/drivers/thermal/thermal_core.h > > b/drivers/thermal/thermal_core.h index d15d243..c3c7b82 100644 > > --- a/drivers/thermal/thermal_core.h > > +++ b/drivers/thermal/thermal_core.h > > @@ -89,9 +89,14 @@ static inline void > > thermal_gov_user_space_unregister(void) {} #ifdef CONFIG_THERMAL_OF > > int of_parse_thermal_zones(void); > > void of_thermal_destroy_zones(void); > > +int of_thermal_get_ntrips(struct thermal_zone_device *); > > #else > > static inline int of_parse_thermal_zones(void) { return 0; } > > static inline void of_thermal_destroy_zones(void) { } > > +static inline int of_thermal_get_ntrips(struct thermal_zone_device > > *) >=20 > You need to declare the parameter name with a name > ---------------^ . >=20 > > +{ >=20 > This produces a compilation error if CONFIG_THERMAL_OF is not set: > In file included from drivers/thermal/step_wise.c:28:0: > drivers/thermal/thermal_core.h: In function =E2=80=98of_thermal_get_n= trips=E2=80=99: > drivers/thermal/thermal_core.h:96:48: error: parameter name omitted > static inline int of_thermal_get_ntrips(struct thermal_zone_device *= ) >=20 Good point. Thanks for check. >=20 >=20 > > + return 0; > > +} > > #endif > > =20 > > #endif /* __THERMAL_CORE_H__ */ > > --=20 > > 2.0.0.rc2 > >=20 --=20 Best regards, Lukasz Majewski Samsung R&D Institute Poland (SRPOL) | Linux Platform Group