Skip to content

Commit 020d86f

Browse files
Rajendra Nayakrafaeljw
authored andcommitted
opp: Don't print an error if required-opps is missing
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 <[email protected]> Reviewed-by: Ulf Hansson <[email protected]> Acked-by: Viresh Kumar <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 7c60610 commit 020d86f

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

drivers/opp/of.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,7 @@ static struct dev_pm_opp *_find_opp_of_np(struct opp_table *opp_table,
9595
static struct device_node *of_parse_required_opp(struct device_node *np,
9696
int index)
9797
{
98-
struct device_node *required_np;
99-
100-
required_np = of_parse_phandle(np, "required-opps", index);
101-
if (unlikely(!required_np)) {
102-
pr_err("%s: Unable to parse required-opps: %pOF, index: %d\n",
103-
__func__, np, index);
104-
}
105-
106-
return required_np;
98+
return of_parse_phandle(np, "required-opps", index);
10799
}
108100

109101
/* The caller must call dev_pm_opp_put_opp_table() after the table is used */
@@ -1327,7 +1319,7 @@ int of_get_required_opp_performance_state(struct device_node *np, int index)
13271319

13281320
required_np = of_parse_required_opp(np, index);
13291321
if (!required_np)
1330-
return -EINVAL;
1322+
return -ENODEV;
13311323

13321324
opp_table = _find_table_of_opp_np(required_np);
13331325
if (IS_ERR(opp_table)) {

0 commit comments

Comments
 (0)