OSDN Git Service

clk: Fix debugfs clk_possible_parents for clks without parent string names
authorChen-Yu Tsai <wens@csie.org>
Fri, 3 May 2019 03:15:09 +0000 (11:15 +0800)
committerChen-Yu Tsai <wens@csie.org>
Tue, 18 Jun 2019 11:38:59 +0000 (19:38 +0800)
commit2d156b78ce8febf15cd58a025d7d9d7b7577126a
treed0c4de9320e4efc1b806267cce1f291fff701d1a
parenta188339ca5a396acc588e5851ed7e19f66b0ebd9
clk: Fix debugfs clk_possible_parents for clks without parent string names

Following the commit fc0c209c147f ("clk: Allow parents to be specified
without string names"), the parent name string is not always populated.

Instead, fetch the parents clk_core struct using the appropriate helper,
and read its name directly. If that fails, go through the possible
sources of parent names. The order in which they are used is different
from how parents are looked up, with the global name having precedence
over local fw_name and indices. This makes more sense as a) the
parent_maps structure does not differentiate between legacy global names
and fallback global names, and b) global names likely provide more
information than local fw_names.

Fixes: fc0c209c147f ("clk: Allow parents to be specified without string names")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
drivers/clk/clk.c