[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKohponRwcd8C-OyhrY2ExgMUP-WcrYo641j6osXekmRTc4m6A@mail.gmail.com>
Date: Tue, 20 May 2014 19:01:55 +0530
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Nishanth Menon <nm@...com>
Cc: Chander Kashyap <chander.kashyap@...aro.org>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Pavel Machek <pavel@....cz>,
"Brown, Len" <len.brown@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Chander Kashyap <k.chander@...sung.com>,
Inderpal Singh <inderpal.s@...sung.com>
Subject: Re: [PATCH v3] PM / OPP: discard duplicate OPPs
On 20 May 2014 17:35, Viresh Kumar <viresh.kumar@...aro.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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists