]> git.baikalelectronics.ru Git - kernel.git/commit
bus: ti-sysc: Fix iterating over clocks
authorTony Lindgren <tony@atomide.com>
Mon, 16 Dec 2019 22:41:53 +0000 (14:41 -0800)
committerTony Lindgren <tony@atomide.com>
Mon, 16 Dec 2019 22:55:22 +0000 (14:55 -0800)
commite3ca45875b879951a433d576fe406ddea1828aab
tree6576d62c876c23b46950e18cff2fbbe8ac1881c9
parenteef1fc6ff1e527931c1cab3d2e49b816453b05f3
bus: ti-sysc: Fix iterating over clocks

Commit 3ba54a7e860f ("bus: ti-sysc: Add separate functions for handling
clocks") separated handling of optional clocks from the main clocks, but
introduced an issue where we do not necessarily allocate a slot for both
fck and ick clocks, but still assume fixed slots for enumerating over the
clocks.

Let's fix the issue by ensuring we always have slots for both fck and ick
even if we don't use ick, and don't attempt to enumerate optional clocks
if not allocated.

In the long run we might want to simplify things a bit by only allocating
space only for the optional clocks as we have only few devices with
optional clocks.

Fixes: 3ba54a7e860f ("bus: ti-sysc: Add separate functions for handling clocks")
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/bus/ti-sysc.c