Skip to content
Commit 64ce8545 authored by Chander Kashyap's avatar Chander Kashyap Committed by Rafael J. Wysocki
Browse files

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: default avatarNishanth Menon <nm@ti.com>
Signed-off-by: default avatarChander Kashyap <k.chander@samsung.com>
Signed-off-by: default avatarInderpal Singh <inderpal.s@samsung.com>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 049d595a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment