Skip to content

Commit

Permalink
opp: Don't print an error if required-opps is missing
Browse files Browse the repository at this point in the history
[ Upstream commit 020d86f ]

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: Rajendra Nayak <rnayak@codeaurora.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Rajendra Nayak authored and gregkh committed Sep 18, 2021
1 parent 3f2afd3 commit 86230f4
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions drivers/opp/of.c
Expand Up @@ -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,
int index)
{
struct device_node *required_np;

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;
return of_parse_phandle(np, "required-opps", index);
}

/* The caller must call dev_pm_opp_put_opp_table() after the table is used */
Expand Down Expand Up @@ -1349,7 +1341,7 @@ int of_get_required_opp_performance_state(struct device_node *np, int index)

required_np = of_parse_required_opp(np, index);
if (!required_np)
return -EINVAL;
return -ENODEV;

opp_table = _find_table_of_opp_np(required_np);
if (IS_ERR(opp_table)) {
Expand Down

0 comments on commit 86230f4

Please sign in to comment.