PM / OPP: predictable fail results for opp_find* functions
MyungJoo Ham
Acked-byQuoted 27 lines
Currently the opp_find* functions return
-ENODEVwhen:
a) it cant find a device (e.g. request for an OPP search on device which was not registered)
b) When it cant find a match for the search strategy usedThis makes life a little in-efficient for users such as devfreq to make reasonable judgement before switching search strategies.
So, standardize the return results as following:
-EINVALfor bad pointer parameters
-ENODEVwhen device cannot be found
-ERANGEwhen search failsThis has the following benefit for devfreq implementation:
Current code:
opp =opp_find_freq_floor(dev, freq);
/* Following search triggers even for un-registered device */ if (opp ==ERR_PTR(-ENODEV))opp = opp_find_freq_ceil(dev, freq);Vs (after this change):
opp =opp_find_freq_floor(dev, freq);
/* Will only be triggered if search logic fails: intended usage */ if (opp ==ERR_PTR(-ERANGE))opp = opp_find_freq_ceil(dev, freq);
Quoted 8 lines
Cc MyungJoo Ham <[email protected]>Cc Kyungmin Park <[email protected]>Cc "Rafael J. Wysocki" <[email protected]>Cc Kevin Hilman <[email protected]>Signed-off-by Nishanth Menon <[email protected]>
Thanks.
Quoted 1 line
�淸�{.n�+돴윯돪�+%듚�깁負쪐w��{.n�+돴쪐{깸G쳺��{ay����,j�f"톒쉹��묎�z_溫(�쉸듶줷"얎�m����G쳺�◀?솳鈺�&x�~뤳턨O뺞촾퇉v�^�m����띠�◀?뻀�