Commit caeb057c authored by Stephen Boyd's avatar Stephen Boyd

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: default avatarStephen Boyd <sboyd@codeaurora.org>
parent ebf3f9a9
...@@ -244,10 +244,10 @@ static const char ** __init flexgen_get_parents(struct device_node *np, ...@@ -244,10 +244,10 @@ static const char ** __init flexgen_get_parents(struct device_node *np,
int *num_parents) int *num_parents)
{ {
const char **parents; const char **parents;
int nparents; unsigned int nparents;
nparents = of_clk_get_parent_count(np); nparents = of_clk_get_parent_count(np);
if (WARN_ON(nparents <= 0)) if (WARN_ON(!nparents))
return NULL; return NULL;
parents = kcalloc(nparents, sizeof(const char *), GFP_KERNEL); parents = kcalloc(nparents, sizeof(const char *), GFP_KERNEL);
......
...@@ -26,10 +26,10 @@ static const char ** __init clkgen_mux_get_parents(struct device_node *np, ...@@ -26,10 +26,10 @@ static const char ** __init clkgen_mux_get_parents(struct device_node *np,
int *num_parents) int *num_parents)
{ {
const char **parents; const char **parents;
int nparents; unsigned int nparents;
nparents = of_clk_get_parent_count(np); nparents = of_clk_get_parent_count(np);
if (WARN_ON(nparents <= 0)) if (WARN_ON(!nparents))
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
parents = kcalloc(nparents, sizeof(const char *), GFP_KERNEL); parents = kcalloc(nparents, sizeof(const char *), GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment