diff options
author | Stephen Boyd <sboyd@kernel.org> | 2019-04-30 10:22:30 -0700 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2019-05-03 10:38:01 -0700 |
commit | 1a079560b1450b72ff4e944bb9185e77633d74c4 (patch) | |
tree | 813133407b3a887e7525350ab5bed50848a10e59 /drivers/clk/x86/clk-lpt.c | |
parent | e4818d615b58f145ace70fefa43aeae8611b55a1 (diff) |
clk: Cache core in clk_fetch_parent_index() without names
If a clk has specified parents via clk_hw pointers it won't specify the
globally unique names for the parents. Without the unique names, we
can't fallback to comparing them against the name of the 'parent'
pointer here. Therefore, do a pointer comparison against the clk_hw
pointers too and cache the clk_core structure if they match. This fixes
parent lookup code for clks that only specify clk_hw pointers and
nothing else, like muxes that are purely inside a clk controller.
Similarly, if the parent pointer isn't cached after trying to match
clk_core or clk_hw pointers, lookup the pointer from DT or via clkdev
lookups instead of relying purely on the globally unique clk name match.
This should allow us to move away from having to specify global names
for clk parents entirely.
While we're in the area, add some comments so it's clearer what's going
on. The if statements don't lend themselves to much clarity in their raw
form.
Fixes: fc0c209c147f ("clk: Allow parents to be specified without string names")
Reported-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/x86/clk-lpt.c')
0 files changed, 0 insertions, 0 deletions