mirror of
https://github.com/torvalds/linux.git
synced 2024-11-28 07:01:32 +00:00
clk: simplify clk_core_get_parent_by_index()
Drop the "if (!core->parents)" case and refactor the function a bit because core->parents is always allocated. (Strictly speaking, it is ZERO_SIZE_PTR if core->num_parents == 0, but such a case is omitted by the if-conditional above.) Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Vladimir Zapolskiy <vz@mleia.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
This commit is contained in:
parent
176d11690b
commit
88cfbef2ac
@ -350,13 +350,12 @@ static struct clk_core *clk_core_get_parent_by_index(struct clk_core *core,
|
|||||||
{
|
{
|
||||||
if (!core || index >= core->num_parents)
|
if (!core || index >= core->num_parents)
|
||||||
return NULL;
|
return NULL;
|
||||||
else if (!core->parents)
|
|
||||||
return clk_core_lookup(core->parent_names[index]);
|
if (!core->parents[index])
|
||||||
else if (!core->parents[index])
|
core->parents[index] =
|
||||||
return core->parents[index] =
|
clk_core_lookup(core->parent_names[index]);
|
||||||
clk_core_lookup(core->parent_names[index]);
|
|
||||||
else
|
return core->parents[index];
|
||||||
return core->parents[index];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct clk_hw *
|
struct clk_hw *
|
||||||
|
Loading…
Reference in New Issue
Block a user