Commit 27ff8187 authored by YueHaibing's avatar YueHaibing Committed by Viresh Kumar

opp: Fix return in _opp_add_static_v2()

Fix sparse warning:
drivers/opp/of.c:924 _opp_add_static_v2() warn: passing zero to 'ERR_PTR'

For duplicate OPPs 'ret' be set to zero.

Fixes: deac8703 ("PM / OPP: _of_add_opp_table_v2(): increment count only if OPP is added")
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent 4844bdbe
...@@ -921,7 +921,7 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table, ...@@ -921,7 +921,7 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table,
free_opp: free_opp:
_opp_free(new_opp); _opp_free(new_opp);
return ERR_PTR(ret); return ret ? ERR_PTR(ret) : NULL;
} }
/* Initializes OPP tables based on new bindings */ /* Initializes OPP tables based on new bindings */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment