Skip to content

Commit 6ee70e8

Browse files
nicola-mazzucato-armvireshk
authored andcommitted
opp: of: Allow empty opp-table with opp-shared
The opp binding now allows to have an empty opp table and shared-opp to still describe that devices share v/f lines. When initialising an empty opp table, allow such case by: - treating such conditions with warnings in place of errors - don't fail on empty table Signed-off-by: Nicola Mazzucato <nicola.mazzucato@arm.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent 24b3c96 commit 6ee70e8

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

drivers/opp/of.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ static void _opp_table_alloc_required_tables(struct opp_table *opp_table,
169169
/* Traversing the first OPP node is all we need */
170170
np = of_get_next_available_child(opp_np, NULL);
171171
if (!np) {
172-
dev_err(dev, "Empty OPP table\n");
172+
dev_warn(dev, "Empty OPP table\n");
173+
173174
return;
174175
}
175176

@@ -377,7 +378,9 @@ int dev_pm_opp_of_find_icc_paths(struct device *dev,
377378
struct icc_path **paths;
378379

379380
ret = _bandwidth_supported(dev, opp_table);
380-
if (ret <= 0)
381+
if (ret == -EINVAL)
382+
return 0; /* Empty OPP table is a valid corner-case, let's not fail */
383+
else if (ret <= 0)
381384
return ret;
382385

383386
ret = 0;

0 commit comments

Comments
 (0)