clk: simplify clk_core_get_parent_by_index()
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Mon, 28 Dec 2015 10:23:01 +0000 (19:23 +0900)
committerStephen Boyd <sboyd@codeaurora.org>
Tue, 2 Feb 2016 01:01:50 +0000 (17:01 -0800)
commit88cfbef2acd38443c3eed780263b5f5e95a8dc1f
tree4da2bbb704c306b49a6008f1c5f5846c13b0d8b7
parent176d11690ba2c8ad59f99734d692f19f451c408b
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>
drivers/clk/clk.c