diff options
| -rw-r--r-- | drivers/clk/clk.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index c9860074899b..79d0466cd180 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c | |||
| @@ -345,23 +345,18 @@ unsigned int __clk_get_enable_count(struct clk *clk) | |||
| 345 | 345 | ||
| 346 | static unsigned long clk_core_get_rate_nolock(struct clk_core *core) | 346 | static unsigned long clk_core_get_rate_nolock(struct clk_core *core) |
| 347 | { | 347 | { |
| 348 | unsigned long ret; | 348 | if (!core) |
| 349 | 349 | return 0; | |
| 350 | if (!core) { | ||
| 351 | ret = 0; | ||
| 352 | goto out; | ||
| 353 | } | ||
| 354 | |||
| 355 | ret = core->rate; | ||
| 356 | |||
| 357 | if (!core->num_parents) | ||
| 358 | goto out; | ||
| 359 | 350 | ||
| 360 | if (!core->parent) | 351 | if (!core->num_parents || core->parent) |
| 361 | ret = 0; | 352 | return core->rate; |
| 362 | 353 | ||
| 363 | out: | 354 | /* |
| 364 | return ret; | 355 | * Clk must have a parent because num_parents > 0 but the parent isn't |
| 356 | * known yet. Best to return 0 as the rate of this clk until we can | ||
| 357 | * properly recalc the rate based on the parent's rate. | ||
| 358 | */ | ||
| 359 | return 0; | ||
| 365 | } | 360 | } |
| 366 | 361 | ||
| 367 | unsigned long clk_hw_get_rate(const struct clk_hw *hw) | 362 | unsigned long clk_hw_get_rate(const struct clk_hw *hw) |
