summaryrefslogtreecommitdiffstats
path: root/drivers/clk/st/clkgen-mux.c
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2016-02-20 02:43:30 +0100
committerStephen Boyd <sboyd@codeaurora.org>2016-02-27 01:01:32 +0100
commitcaeb057cd30412b85e69f663a43f55a29666c79b (patch)
tree03206ff2e895af95c99e2e9a1655fae3abc98e63 /drivers/clk/st/clkgen-mux.c
parentclk: h8300: Remove impossible check for of_clk_get_parent_count() (diff)
downloadlinux-caeb057cd30412b85e69f663a43f55a29666c79b.tar.xz
linux-caeb057cd30412b85e69f663a43f55a29666c79b.zip
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>
Diffstat (limited to 'drivers/clk/st/clkgen-mux.c')
-rw-r--r--drivers/clk/st/clkgen-mux.c4
1 files changed, 2 insertions, 2 deletions
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,
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);