linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Gautham R Shenoy <ego@linux.vnet.ibm.com>
To: Yangtao Li <tiny.windzz@gmail.com>
Cc: linux-pm@vger.kernel.org, viresh.kumar@linaro.org,
	rjw@rjwysocki.net, linux-kernel@vger.kernel.org,
	paulus@samba.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] cpufreq: powernv: add of_node_put()
Date: Mon, 26 Nov 2018 18:12:54 +0530	[thread overview]
Message-ID: <20181126124254.GC21536@in.ibm.com> (raw)
In-Reply-To: <20181120125731.19368-1-tiny.windzz@gmail.com>

Hello Yangtao Li,

On Tue, Nov 20, 2018 at 07:57:31AM -0500, Yangtao Li wrote:
> use of_node_put() to release the refcount.
>

Thanks for the patch.

Reviewed-by: Gautham R. Shenoy <ego@linux.vnet.ibm.com>

> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
> ---
>  drivers/cpufreq/powernv-cpufreq.c | 17 +++++++++++------
>  1 file changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c
> index bf6519cf64bc..7e7ad3879c4e 100644
> --- a/drivers/cpufreq/powernv-cpufreq.c
> +++ b/drivers/cpufreq/powernv-cpufreq.c
> @@ -253,18 +253,18 @@ static int init_powernv_pstates(void)
> 
>  	if (of_property_read_u32(power_mgt, "ibm,pstate-min", &pstate_min)) {
>  		pr_warn("ibm,pstate-min node not found\n");
> -		return -ENODEV;
> +		goto out;
>  	}
> 
>  	if (of_property_read_u32(power_mgt, "ibm,pstate-max", &pstate_max)) {
>  		pr_warn("ibm,pstate-max node not found\n");
> -		return -ENODEV;
> +		goto out;
>  	}
> 
>  	if (of_property_read_u32(power_mgt, "ibm,pstate-nominal",
>  				 &pstate_nominal)) {
>  		pr_warn("ibm,pstate-nominal not found\n");
> -		return -ENODEV;
> +		goto out;
>  	}
> 
>  	if (of_property_read_u32(power_mgt, "ibm,pstate-ultra-turbo",
> @@ -293,14 +293,14 @@ static int init_powernv_pstates(void)
>  	pstate_ids = of_get_property(power_mgt, "ibm,pstate-ids", &len_ids);
>  	if (!pstate_ids) {
>  		pr_warn("ibm,pstate-ids not found\n");
> -		return -ENODEV;
> +		goto out;
>  	}
> 
>  	pstate_freqs = of_get_property(power_mgt, "ibm,pstate-frequencies-mhz",
>  				      &len_freqs);
>  	if (!pstate_freqs) {
>  		pr_warn("ibm,pstate-frequencies-mhz not found\n");
> -		return -ENODEV;
> +		goto out;
>  	}
> 
>  	if (len_ids != len_freqs) {
> @@ -311,7 +311,7 @@ static int init_powernv_pstates(void)
>  	nr_pstates = min(len_ids, len_freqs) / sizeof(u32);
>  	if (!nr_pstates) {
>  		pr_warn("No PStates found\n");
> -		return -ENODEV;
> +		goto out;
>  	}
> 
>  	powernv_pstate_info.nr_pstates = nr_pstates;
> @@ -352,7 +352,12 @@ static int init_powernv_pstates(void)
> 
>  	/* End of list marker entry */
>  	powernv_freqs[i].frequency = CPUFREQ_TABLE_END;
> +
> +	of_node_put(power_mgt);
>  	return 0;
> +out:
> +	of_node_put(power_mgt);
> +	return -ENODEV;
>  }
> 
>  /* Returns the CPU frequency corresponding to the pstate_id. */
> -- 
> 2.17.0
> 


      parent reply	other threads:[~2018-11-26 12:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-20 12:57 [PATCH] cpufreq: powernv: add of_node_put() Yangtao Li
2018-11-20 15:26 ` Rafael J. Wysocki
2018-11-26 12:42 ` Gautham R Shenoy [this message]

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=20181126124254.GC21536@in.ibm.com \
    --to=ego@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    --cc=rjw@rjwysocki.net \
    --cc=tiny.windzz@gmail.com \
    --cc=viresh.kumar@linaro.org \
    /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;
as well as URLs for NNTP newsgroup(s).