linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Nishanth Menon <nm@ti.com>
Cc: Chander Kashyap <chander.kashyap@linaro.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Pavel Machek <pavel@ucw.cz>, "Brown, Len" <len.brown@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Chander Kashyap <k.chander@samsung.com>,
	Inderpal Singh <inderpal.s@samsung.com>
Subject: Re: [PATCH v3] PM / OPP: discard duplicate OPPs
Date: Tue, 20 May 2014 19:01:55 +0530	[thread overview]
Message-ID: <CAKohponRwcd8C-OyhrY2ExgMUP-WcrYo641j6osXekmRTc4m6A@mail.gmail.com> (raw)
In-Reply-To: <CAKohpomKvPcioNmfzvx7vqJHqs_TrhnHH6yYb5w_0f+YvA5hvA@mail.gmail.com>

On 20 May 2014 17:35, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> Though after more thought into this I feel this must also be done:
>
> diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
> index bdf09f5..3f540d8 100644
> --- a/drivers/base/power/opp.c
> +++ b/drivers/base/power/opp.c
> @@ -453,9 +453,13 @@ int dev_pm_opp_add(struct device *dev, unsigned
> long freq, unsigned long u_volt)
>         }
>
>         if (new_opp->rate == opp->rate) {
> +               int ret = 0;
> +
> +               if (new_opp->u_volt == opp->u_volt)
> +                       ret = -EEXIST;
>                 mutex_unlock(&dev_opp_list_lock);
>                 kfree(new_opp);
> -               return 0;
> +               return ret;

Ahh, sorry gentlemen. I have screwed up yet again.

I meant this instead:

> +               if (new_opp->u_volt != opp->u_volt)
> +                       ret = -EEXIST;

Otherwise we are trying to add same OPP again and we can
return zero.

  parent reply	other threads:[~2014-05-20 13:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-16  9:00 [PATCH v3] PM / OPP: discard duplicate OPPs Chander Kashyap
2014-05-16 10:03 ` Viresh Kumar
2014-05-19 13:08 ` Nishanth Menon
2014-05-20  4:00   ` Viresh Kumar
2014-05-20 11:24     ` Nishanth Menon
2014-05-20 11:26       ` Viresh Kumar
2014-05-20 12:05         ` Viresh Kumar
2014-05-20 12:32           ` Nishanth Menon
2014-05-20 13:36             ` Viresh Kumar
2014-05-20 12:45           ` Rafael J. Wysocki
2014-05-20 13:29             ` Viresh Kumar
2014-05-20 13:31           ` Viresh Kumar [this message]
2014-05-20 13:36             ` Nishanth Menon

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=CAKohponRwcd8C-OyhrY2ExgMUP-WcrYo641j6osXekmRTc4m6A@mail.gmail.com \
    --to=viresh.kumar@linaro.org \
    --cc=chander.kashyap@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=inderpal.s@samsung.com \
    --cc=k.chander@samsung.com \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    /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).