public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Cc: linux-pm@vger.kernel.org,
	Wolfram Sang <wsa+renesas@sang-engineering.com>,
	linux-renesas-soc@vger.kernel.org,
	Zhang Rui <rui.zhang@intel.com>,
	Eduardo Valentin <edubezval@gmail.com>
Subject: Re: [PATCH v2 4/7] thermal: rcar_gen3_thermal: record and check number of TSCs found
Date: Mon, 20 Mar 2017 21:09:39 +0100	[thread overview]
Message-ID: <20170320200939.GB1587@katana> (raw)
In-Reply-To: <20170317155300.21566-5-niklas.soderlund+renesas@ragnatech.se>

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

On Fri, Mar 17, 2017 at 04:52:57PM +0100, Niklas Söderlund wrote:
> Record how many TSCs are found in struct rcar_gen3_thermal_priv, this is
> needed to be able to add hardware interrupts for trip points later. Also
> add a check to make sure at least one TSC is found.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
>  drivers/thermal/rcar_gen3_thermal.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c
> index 9b6bc03dd142a8dd..3b6e85abfadc61a3 100644
> --- a/drivers/thermal/rcar_gen3_thermal.c
> +++ b/drivers/thermal/rcar_gen3_thermal.c
> @@ -74,6 +74,7 @@ struct rcar_gen3_thermal_tsc {
>  };
>  
>  struct rcar_gen3_thermal_priv {
> +	unsigned int num_tscs;
>  	struct rcar_gen3_thermal_tsc *tscs[TSC_MAX_NUM];
>  };
>  
> @@ -305,6 +306,12 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev)
>  			goto error_unregister;
>  		}
>  		tsc->zone = zone;
> +		priv->num_tscs++;
> +	}
> +
> +	if (!priv->num_tscs) {
> +		ret = -ENODEV;
> +		goto error_unregister;

I would have probably done 'priv->num_tscs = i;' after the loop instead
of 'priv->num_tscs++;' in the loop, but that is super-minor.

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  parent reply	other threads:[~2017-03-20 20:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-17 15:52 [PATCH v2 0/7] thermal: rcar_gen3_thermal: add support for interrupt triggerd trip points Niklas Söderlund
2017-03-17 15:52 ` [PATCH v2 1/7] thermal: rcar_gen3_thermal: add delay in .thermal_init on r8a7796 Niklas Söderlund
2017-03-17 15:52 ` [PATCH v2 2/7] thermal: rcar_gen3_thermal: remove unneeded mutex Niklas Söderlund
2017-03-18  9:30   ` Sergei Shtylyov
2017-03-17 15:52 ` [PATCH v2 3/7] thermal: rcar_gen3_thermal: check that TSC exists before memory allocation Niklas Söderlund
2017-03-18 14:06   ` Geert Uytterhoeven
2017-03-20 20:02   ` Wolfram Sang
2017-03-17 15:52 ` [PATCH v2 4/7] thermal: rcar_gen3_thermal: record and check number of TSCs found Niklas Söderlund
2017-03-18 14:09   ` Geert Uytterhoeven
2017-03-20 20:09   ` Wolfram Sang [this message]
2017-03-17 15:52 ` [PATCH v2 5/7] thermal: rcar_gen3_thermal: enable hardware interrupts for trip points Niklas Söderlund
2017-03-20 20:25   ` Wolfram Sang
2017-03-17 15:52 ` [PATCH v2 6/7] thermal: rcar_gen3_thermal: store device match data in private structure Niklas Söderlund
2017-03-17 15:53 ` [PATCH v2 7/7] thermal: rcar_gen3_thermal: add suspend and resume support Niklas Söderlund
2017-03-20 20:27   ` Wolfram Sang

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=20170320200939.GB1587@katana \
    --to=wsa@the-dreams.de \
    --cc=edubezval@gmail.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=rui.zhang@intel.com \
    --cc=wsa+renesas@sang-engineering.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox