All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduardo Valentin <edubezval@gmail.com>
To: Kapileshwar Singh <kapileshwar.singh@arm.com>
Cc: linux-pm@vger.kernel.org, rui.zhang@intel.com,
	javi.merino@arm.com, punit.agrawal@arm.com
Subject: Re: [PATCH 1/2] thermal: of: Match function to pass bindparam index
Date: Tue, 20 Jan 2015 09:44:10 -0400	[thread overview]
Message-ID: <20150120134408.GA5830@developer.hsd1.ca.comcast.net> (raw)
In-Reply-To: <1421171482-16101-2-git-send-email-kapileshwar.singh@arm.com>

[-- Attachment #1: Type: text/plain, Size: 2424 bytes --]

On Tue, Jan 13, 2015 at 05:51:21PM +0000, Kapileshwar Singh wrote:
> From: KP Singh <kapileshwar.singh@arm.com>

The encoding still seams to be scrambled to me.

> 
> The match function should pass the index of the binding parameters
> which the cooling device needs to be matched against. There are currently
> no implementations of match function within the kernel. A successful
> match requires:
> 
> 	trip_mask == expected_trip_mask;
> 	weight == expected_weight;
> 	binding_limits == expected_binding_limits;
> 	thermal_zone == expected_thermal_zone;

ok. The .match callback is documented under
Documentation/thermal/sysfs-api.txt. Can you please also make sure the
documentation is sane after your change?

> 
> Signed-off-by: Kapileshwar Singh <kapileshwar.singh@arm.com>
> ---
>  drivers/thermal/thermal_core.c |    4 ++--
>  include/linux/thermal.h        |    2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 87e0b0782023..db4d6407c1ec 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -276,7 +276,7 @@ static void bind_cdev(struct thermal_cooling_device *cdev)
>  		for (i = 0; i < tzp->num_tbps; i++) {
>  			if (tzp->tbp[i].cdev || !tzp->tbp[i].match)
>  				continue;
> -			if (tzp->tbp[i].match(pos, cdev))
> +			if (tzp->tbp[i].match(pos, cdev, i))
>  				continue;
>  			tzp->tbp[i].cdev = cdev;
>  			__bind(pos, tzp->tbp[i].trip_mask, cdev,
> @@ -315,7 +315,7 @@ static void bind_tz(struct thermal_zone_device *tz)
>  		for (i = 0; i < tzp->num_tbps; i++) {
>  			if (tzp->tbp[i].cdev || !tzp->tbp[i].match)
>  				continue;
> -			if (tzp->tbp[i].match(tz, pos))
> +			if (tzp->tbp[i].match(tz, pos, i))
>  				continue;
>  			tzp->tbp[i].cdev = pos;
>  			__bind(tz, tzp->tbp[i].trip_mask, pos,
> diff --git a/include/linux/thermal.h b/include/linux/thermal.h
> index fc52e307efab..dc8cf6dc59e5 100644
> --- a/include/linux/thermal.h
> +++ b/include/linux/thermal.h
> @@ -237,7 +237,7 @@ struct thermal_bind_params {
>  	 */
>  	unsigned long *binding_limits;
>  	int (*match) (struct thermal_zone_device *tz,
> -			struct thermal_cooling_device *cdev);
> +		      struct thermal_cooling_device *cdev, int index);
>  };
>  
>  /* Structure to define Thermal Zone parameters */
> -- 
> 1.7.9.5
> 
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2015-01-20 13:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-13 17:51 [PATCH 0/2] thermal: of: Fix for cooling devices Kapileshwar Singh
2015-01-13 17:51 ` [PATCH 1/2] thermal: of: Match function to pass bindparam index Kapileshwar Singh
2015-01-20 13:44   ` Eduardo Valentin [this message]
2015-01-13 17:51 ` [PATCH 2/2] thermal: of: Match function for of-thermal Kapileshwar Singh
2015-01-20 13:57   ` Eduardo Valentin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150120134408.GA5830@developer.hsd1.ca.comcast.net \
    --to=edubezval@gmail.com \
    --cc=javi.merino@arm.com \
    --cc=kapileshwar.singh@arm.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=punit.agrawal@arm.com \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.