提交 f279262a 编写于 作者: R Rajendra Nayak 提交者: Zheng Zengkai

opp: Don't print an error if required-opps is missing

stable inclusion
from stable-5.10.67
commit a99eec36ed39f7717827d15aeb329fe0e17396e5
bugzilla: 182619 https://gitee.com/openeuler/kernel/issues/I4EWO7

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a99eec36ed39f7717827d15aeb329fe0e17396e5

--------------------------------

[ Upstream commit 020d86fc ]

The 'required-opps' property is considered optional, hence remove
the pr_err() in of_parse_required_opp() when we find the property is
missing.
While at it, also fix the return value of
of_get_required_opp_performance_state() when of_parse_required_opp()
fails, return a -ENODEV instead of the -EINVAL.
Signed-off-by: NRajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: NUlf Hansson <ulf.hansson@linaro.org>
Acked-by: NViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 ed505429
...@@ -95,15 +95,7 @@ static struct dev_pm_opp *_find_opp_of_np(struct opp_table *opp_table, ...@@ -95,15 +95,7 @@ static struct dev_pm_opp *_find_opp_of_np(struct opp_table *opp_table,
static struct device_node *of_parse_required_opp(struct device_node *np, static struct device_node *of_parse_required_opp(struct device_node *np,
int index) int index)
{ {
struct device_node *required_np; return of_parse_phandle(np, "required-opps", index);
required_np = of_parse_phandle(np, "required-opps", index);
if (unlikely(!required_np)) {
pr_err("%s: Unable to parse required-opps: %pOF, index: %d\n",
__func__, np, index);
}
return required_np;
} }
/* The caller must call dev_pm_opp_put_opp_table() after the table is used */ /* The caller must call dev_pm_opp_put_opp_table() after the table is used */
...@@ -1193,7 +1185,7 @@ int of_get_required_opp_performance_state(struct device_node *np, int index) ...@@ -1193,7 +1185,7 @@ int of_get_required_opp_performance_state(struct device_node *np, int index)
required_np = of_parse_required_opp(np, index); required_np = of_parse_required_opp(np, index);
if (!required_np) if (!required_np)
return -EINVAL; return -ENODEV;
opp_table = _find_table_of_opp_np(required_np); opp_table = _find_table_of_opp_np(required_np);
if (IS_ERR(opp_table)) { if (IS_ERR(opp_table)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册