diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2016-02-19 20:43:30 -0500 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2016-02-26 19:01:32 -0500 |
commit | caeb057cd30412b85e69f663a43f55a29666c79b (patch) | |
tree | 03206ff2e895af95c99e2e9a1655fae3abc98e63 | |
parent | ebf3f9a9234211ea9de186402b53389de676f1d5 (diff) |
clk: st: Remove impossible check for of_clk_get_parent_count() < 0
The checks for < 0 are impossible now that
of_clk_get_parent_count() returns an unsigned int. Simplify the
code and update the types.
Cc: Gabriel Fernandez <gabriel.fernandez@st.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
-rw-r--r-- | drivers/clk/st/clk-flexgen.c | 4 | ||||
-rw-r--r-- | drivers/clk/st/clkgen-mux.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/drivers/clk/st/clk-flexgen.c b/drivers/clk/st/clk-flexgen.c index 24d99594c0b3..627267c7ec5c 100644 --- a/drivers/clk/st/clk-flexgen.c +++ b/drivers/clk/st/clk-flexgen.c | |||
@@ -244,10 +244,10 @@ static const char ** __init flexgen_get_parents(struct device_node *np, | |||
244 | int *num_parents) | 244 | int *num_parents) |
245 | { | 245 | { |
246 | const char **parents; | 246 | const char **parents; |
247 | int nparents; | 247 | unsigned int nparents; |
248 | 248 | ||
249 | nparents = of_clk_get_parent_count(np); | 249 | nparents = of_clk_get_parent_count(np); |
250 | if (WARN_ON(nparents <= 0)) | 250 | if (WARN_ON(!nparents)) |
251 | return NULL; | 251 | return NULL; |
252 | 252 | ||
253 | parents = kcalloc(nparents, sizeof(const char *), GFP_KERNEL); | 253 | parents = kcalloc(nparents, sizeof(const char *), GFP_KERNEL); |
diff --git a/drivers/clk/st/clkgen-mux.c b/drivers/clk/st/clkgen-mux.c index 0d9a74b66ea3..b1e10ffe7a44 100644 --- a/drivers/clk/st/clkgen-mux.c +++ b/drivers/clk/st/clkgen-mux.c | |||
@@ -26,10 +26,10 @@ static const char ** __init clkgen_mux_get_parents(struct device_node *np, | |||
26 | int *num_parents) | 26 | int *num_parents) |
27 | { | 27 | { |
28 | const char **parents; | 28 | const char **parents; |
29 | int nparents; | 29 | unsigned int nparents; |
30 | 30 | ||
31 | nparents = of_clk_get_parent_count(np); | 31 | nparents = of_clk_get_parent_count(np); |
32 | if (WARN_ON(nparents <= 0)) | 32 | if (WARN_ON(!nparents)) |
33 | return ERR_PTR(-EINVAL); | 33 | return ERR_PTR(-EINVAL); |
34 | 34 | ||
35 | parents = kcalloc(nparents, sizeof(const char *), GFP_KERNEL); | 35 | parents = kcalloc(nparents, sizeof(const char *), GFP_KERNEL); |