Browse Source

clk: ti: Update for of_clk_get_parent_count() returning unsigned int

Change the types here to unsigned int instead of int and update
the checks for == 0 instead < 1 to be more explicit about what's
going on now that of_clk_get_parent_count() has changed return
types.

Cc: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Stephen Boyd 9 years ago
parent
commit
921bacfa34
4 changed files with 8 additions and 8 deletions
  1. 1 1
      drivers/clk/ti/clockdomain.c
  2. 4 4
      drivers/clk/ti/composite.c
  3. 1 1
      drivers/clk/ti/dpll.c
  4. 2 2
      drivers/clk/ti/mux.c

+ 1 - 1
drivers/clk/ti/clockdomain.c

@@ -109,7 +109,7 @@ static void __init of_ti_clockdomain_setup(struct device_node *node)
 	struct clk_hw *clk_hw;
 	struct clk_hw *clk_hw;
 	const char *clkdm_name = node->name;
 	const char *clkdm_name = node->name;
 	int i;
 	int i;
-	int num_clks;
+	unsigned int num_clks;
 
 
 	num_clks = of_clk_get_parent_count(node);
 	num_clks = of_clk_get_parent_count(node);
 
 

+ 4 - 4
drivers/clk/ti/composite.c

@@ -234,14 +234,14 @@ cleanup:
 
 
 static void __init of_ti_composite_clk_setup(struct device_node *node)
 static void __init of_ti_composite_clk_setup(struct device_node *node)
 {
 {
-	int num_clks;
+	unsigned int num_clks;
 	int i;
 	int i;
 	struct clk_hw_omap_comp *cclk;
 	struct clk_hw_omap_comp *cclk;
 
 
 	/* Number of component clocks to be put inside this clock */
 	/* Number of component clocks to be put inside this clock */
 	num_clks = of_clk_get_parent_count(node);
 	num_clks = of_clk_get_parent_count(node);
 
 
-	if (num_clks < 1) {
+	if (!num_clks) {
 		pr_err("composite clk %s must have component(s)\n", node->name);
 		pr_err("composite clk %s must have component(s)\n", node->name);
 		return;
 		return;
 	}
 	}
@@ -271,13 +271,13 @@ CLK_OF_DECLARE(ti_composite_clock, "ti,composite-clock",
 int __init ti_clk_add_component(struct device_node *node, struct clk_hw *hw,
 int __init ti_clk_add_component(struct device_node *node, struct clk_hw *hw,
 				int type)
 				int type)
 {
 {
-	int num_parents;
+	unsigned int num_parents;
 	const char **parent_names;
 	const char **parent_names;
 	struct component_clk *clk;
 	struct component_clk *clk;
 
 
 	num_parents = of_clk_get_parent_count(node);
 	num_parents = of_clk_get_parent_count(node);
 
 
-	if (num_parents < 1) {
+	if (!num_parents) {
 		pr_err("component-clock %s must have parent(s)\n", node->name);
 		pr_err("component-clock %s must have parent(s)\n", node->name);
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}

+ 1 - 1
drivers/clk/ti/dpll.c

@@ -374,7 +374,7 @@ static void __init of_ti_dpll_setup(struct device_node *node,
 	init->ops = ops;
 	init->ops = ops;
 
 
 	init->num_parents = of_clk_get_parent_count(node);
 	init->num_parents = of_clk_get_parent_count(node);
-	if (init->num_parents < 1) {
+	if (!init->num_parents) {
 		pr_err("%s must have parent(s)\n", node->name);
 		pr_err("%s must have parent(s)\n", node->name);
 		goto cleanup;
 		goto cleanup;
 	}
 	}

+ 2 - 2
drivers/clk/ti/mux.c

@@ -178,7 +178,7 @@ static void of_mux_clk_setup(struct device_node *node)
 {
 {
 	struct clk *clk;
 	struct clk *clk;
 	void __iomem *reg;
 	void __iomem *reg;
-	int num_parents;
+	unsigned int num_parents;
 	const char **parent_names;
 	const char **parent_names;
 	u8 clk_mux_flags = 0;
 	u8 clk_mux_flags = 0;
 	u32 mask = 0;
 	u32 mask = 0;
@@ -261,7 +261,7 @@ struct clk_hw *ti_clk_build_component_mux(struct ti_clk_mux *setup)
 static void __init of_ti_composite_mux_clk_setup(struct device_node *node)
 static void __init of_ti_composite_mux_clk_setup(struct device_node *node)
 {
 {
 	struct clk_mux *mux;
 	struct clk_mux *mux;
-	int num_parents;
+	unsigned int num_parents;
 	u32 val;
 	u32 val;
 
 
 	mux = kzalloc(sizeof(*mux), GFP_KERNEL);
 	mux = kzalloc(sizeof(*mux), GFP_KERNEL);