aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/ti/divider.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clk/ti/divider.c')
-rw-r--r--drivers/clk/ti/divider.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/clk/ti/divider.c b/drivers/clk/ti/divider.c
index e6aa10db7bba..bff2b5b8ff59 100644
--- a/drivers/clk/ti/divider.c
+++ b/drivers/clk/ti/divider.c
@@ -211,11 +211,16 @@ static long ti_clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,
211static int ti_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate, 211static int ti_clk_divider_set_rate(struct clk_hw *hw, unsigned long rate,
212 unsigned long parent_rate) 212 unsigned long parent_rate)
213{ 213{
214 struct clk_divider *divider = to_clk_divider(hw); 214 struct clk_divider *divider;
215 unsigned int div, value; 215 unsigned int div, value;
216 unsigned long flags = 0; 216 unsigned long flags = 0;
217 u32 val; 217 u32 val;
218 218
219 if (!hw || !rate)
220 return -EINVAL;
221
222 divider = to_clk_divider(hw);
223
219 div = DIV_ROUND_UP(parent_rate, rate); 224 div = DIV_ROUND_UP(parent_rate, rate);
220 value = _get_val(divider, div); 225 value = _get_val(divider, div);
221 226
@@ -295,8 +300,8 @@ static struct clk *_register_divider(struct device *dev, const char *name,
295 return clk; 300 return clk;
296} 301}
297 302
298static struct clk_div_table 303static struct clk_div_table *
299__init *ti_clk_get_div_table(struct device_node *node) 304__init ti_clk_get_div_table(struct device_node *node)
300{ 305{
301 struct clk_div_table *table; 306 struct clk_div_table *table;
302 const __be32 *divspec; 307 const __be32 *divspec;