]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
OPP: Return correct value in dev_pm_opp_get_level
authorAleks Todorov <aleksbgbg@google.com>
Fri, 23 Jan 2026 14:03:44 +0000 (14:03 +0000)
committerViresh Kumar <viresh.kumar@linaro.org>
Tue, 27 Jan 2026 05:28:50 +0000 (10:58 +0530)
Commit 073d3d2ca7d4 ("OPP: Level zero is valid") modified the
documentation for this function to indicate that errors should return a
non-zero value to avoid colliding with the OPP level zero, however
forgot to actually update the return.

No in-tree kernel code depends on the error value being 0.

Fixes: 073d3d2ca7d4 ("OPP: Level zero is valid")
Signed-off-by: Aleks Todorov <aleksbgbg@google.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/opp/core.c

index dbebb8c829bcb4d6101ae17c09033a91f2ed0a00..ae43c656f108c24b171b0d1a5c5c61efbb756e2e 100644 (file)
@@ -241,7 +241,7 @@ unsigned int dev_pm_opp_get_level(struct dev_pm_opp *opp)
 {
        if (IS_ERR_OR_NULL(opp) || !opp->available) {
                pr_err("%s: Invalid parameters\n", __func__);
-               return 0;
+               return U32_MAX;
        }
 
        return opp->level;