mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-14 10:15:13 +00:00
bus: ti-sysc: Fix getting optional clocks in clock_roles
We can have holes in clock_roles with interface clock missing for
example. Currently getting an optional clock will fail if there are
only a functional clock and an optional clock.
Fixes: 09dfe58107 ("bus: ti-sysc: Add handling for clkctrl opt clocks")
Signed-off-by: Tony Lindgren <tony@atomide.com>
This commit is contained in:
parent
651022382c
commit
7b4f8ac2f1
1 changed files with 7 additions and 2 deletions
|
|
@ -214,8 +214,13 @@ static int sysc_get_clocks(struct sysc *ddata)
|
|||
if (!ddata->clocks)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i = 0; i < ddata->nr_clocks; i++) {
|
||||
error = sysc_get_one_clock(ddata, ddata->clock_roles[i]);
|
||||
for (i = 0; i < SYSC_MAX_CLOCKS; i++) {
|
||||
const char *name = ddata->clock_roles[i];
|
||||
|
||||
if (!name)
|
||||
continue;
|
||||
|
||||
error = sysc_get_one_clock(ddata, name);
|
||||
if (error && error != -ENOENT)
|
||||
return error;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue