]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
clk: st: Remove impossible check for of_clk_get_parent_count() < 0
authorStephen Boyd <sboyd@codeaurora.org>
Sat, 20 Feb 2016 01:43:30 +0000 (17:43 -0800)
committerStephen Boyd <sboyd@codeaurora.org>
Sat, 27 Feb 2016 00:01:32 +0000 (16:01 -0800)
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>
drivers/clk/st/clk-flexgen.c
drivers/clk/st/clkgen-mux.c

index 24d99594c0b30d667251754982ebff75e1a56e26..627267c7ec5c0be3a09ca12fca851e039e0baf06 100644 (file)
@@ -244,10 +244,10 @@ static const char ** __init flexgen_get_parents(struct device_node *np,
                                                       int *num_parents)
 {
        const char **parents;
-       int nparents;
+       unsigned int nparents;
 
        nparents = of_clk_get_parent_count(np);
-       if (WARN_ON(nparents <= 0))
+       if (WARN_ON(!nparents))
                return NULL;
 
        parents = kcalloc(nparents, sizeof(const char *), GFP_KERNEL);
index 0d9a74b66ea3d7fb2b76cc7843ba5ddc0573bddc..b1e10ffe7a4436134148d7bcc035b5498a5e2e51 100644 (file)
@@ -26,10 +26,10 @@ static const char ** __init clkgen_mux_get_parents(struct device_node *np,
                                                       int *num_parents)
 {
        const char **parents;
-       int nparents;
+       unsigned int nparents;
 
        nparents = of_clk_get_parent_count(np);
-       if (WARN_ON(nparents <= 0))
+       if (WARN_ON(!nparents))
                return ERR_PTR(-EINVAL);
 
        parents = kcalloc(nparents, sizeof(const char *), GFP_KERNEL);