clk: Add error handling to clk_fetch_parent_index()
authorTomasz Figa <tomasz.figa@gmail.com>
Sun, 29 Sep 2013 00:37:14 +0000 (02:37 +0200)
committer黄涛 <huangtao@rock-chips.com>
Wed, 8 Jan 2014 03:05:38 +0000 (11:05 +0800)
commit0ab5e56cb4d61e64e0e82d0580b9a463aa69e1f6
tree63a63d6f2777f2a15f7243f29b5d1c240096e5d6
parentf3620ba73f0b38d587b4a7dbe7b11e350eebdada
clk: Add error handling to clk_fetch_parent_index()

There are at least two different error cases that can happen in
clk_fetch_parent_index() function:
 - allocation failure,
 - parent clock lookup failure,
however it returns only an u8, which is supposed to contain parent clock
index.

This patch modified the function to return full int instead allowing
positive clock indices and negative error codes to be returned. All
users of this function are adjusted as well to handle the return value
correctly.

Signed-off-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
drivers/clk/clk.c