]> git.baikalelectronics.ru Git - kernel.git/commit
PM / OPP: discard duplicate OPPs
authorChander Kashyap <k.chander@samsung.com>
Thu, 22 May 2014 05:06:26 +0000 (10:36 +0530)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 26 May 2014 22:50:26 +0000 (00:50 +0200)
commitcae20c44b6ad961e567260af4b7e11f4352cdfe1
tree29c2b8582a71ecdcfc2b2fe64fb26eb61608408a
parenta830d6869bf98484bbb1fa44c3a53d3fd8553972
PM / OPP: discard duplicate OPPs

We don't have any protection against addition of duplicate OPPs currently and in
case some code tries to add them, it will end up corrupting OPP tables.

We need to handle some duplication cases separately as returning error might not
be the right thing always. The new list of return values for dev_pm_opp_add()
are:

 0:         On success OR
            Duplicate OPPs (both freq and volt are same) and opp->available
 -EEXIST:   Freq are same and volt are different OR
            Duplicate OPPs (both freq and volt are same) and !opp->available
 -ENOMEM:   Memory allocation failure

Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Chander Kashyap <k.chander@samsung.com>
Signed-off-by: Inderpal Singh <inderpal.s@samsung.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/power/opp.c