opp: Reorder the code for !target_freq case
Reorder the code a bit to make it more readable. Add additional comment as well. Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Clément Péron <peron.clem@gmail.com> Tested-by: Clément Péron <peron.clem@gmail.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
This commit is contained in:
parent
0430b1d570
commit
b23dfa3543
@ -817,15 +817,21 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (unlikely(!target_freq)) {
|
if (unlikely(!target_freq)) {
|
||||||
if (opp_table->required_opp_tables) {
|
/*
|
||||||
ret = _set_required_opps(dev, opp_table, NULL);
|
* Some drivers need to support cases where some platforms may
|
||||||
} else if (!_get_opp_count(opp_table)) {
|
* have OPP table for the device, while others don't and
|
||||||
|
* opp_set_rate() just needs to behave like clk_set_rate().
|
||||||
|
*/
|
||||||
|
if (!_get_opp_count(opp_table))
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
|
||||||
|
if (!opp_table->required_opp_tables) {
|
||||||
dev_err(dev, "target frequency can't be 0\n");
|
dev_err(dev, "target frequency can't be 0\n");
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
|
goto put_opp_table;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = _set_required_opps(dev, opp_table, NULL);
|
||||||
goto put_opp_table;
|
goto put_opp_table;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user