lkml.org 
[lkml]   [2014]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] PM / OPP: fix incorrect OPP count handling in of_init_opp_table
From
On Fri, May 16, 2014 at 5:51 AM, Chander Kashyap
<chander.kashyap@linaro.org> wrote:
> In of_init_opp_table function, if a failure to add an OPP is
> detected, the count of OPPs, yet to be added is not updated.
> Fix this by decrementing this count on failure as well.
>
> Signed-off-by: Chander Kashyap <k.chander@samsung.com>
> Signed-off-by: Inderpal Singh <inderpal.s@samsung.com>
> ---
> drivers/base/power/opp.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c
> index d9e376a..faae9cf 100644
> --- a/drivers/base/power/opp.c
> +++ b/drivers/base/power/opp.c
> @@ -643,11 +643,9 @@ int of_init_opp_table(struct device *dev)
> unsigned long freq = be32_to_cpup(val++) * 1000;
> unsigned long volt = be32_to_cpup(val++);
>
> - if (dev_pm_opp_add(dev, freq, volt)) {
> + if (dev_pm_opp_add(dev, freq, volt))
> dev_warn(dev, "%s: Failed to add OPP %ld\n",
> __func__, freq);
> - continue;
> - }
> nr -= 2;
> }
Good Catch. Thanks.

Acked-by: Nishanth Menon <nm@ti.com>

--
Regards,
Nishanth Menon


\
 
 \ /
  Last update: 2014-05-19 15:41    [W:0.112 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site