]> www.infradead.org Git - users/dwmw2/linux.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Sep 2019 07:11:02 +0000 (09:11 +0200)
commit268311c39a7f8cc93a3a2b455b0a4718d4534dd3
tree65dcd8cc77fad5c09ecedd21116e52cfa21a4cd5
parenta9258bc6e0b30b213485ff3f5948b770907b58d6
clk: Fix debugfs clk_possible_parents for clks without parent string names

commit 2d156b78ce8febf15cd58a025d7d9d7b7577126a upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/clk/clk.c