aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/clk.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2012-11-21 04:06:05 -0500
committerOlof Johansson <olof@lixom.net>2012-11-21 05:13:11 -0500
commit17bffc78438d010c3e57ad5c1956e3ab50be423a (patch)
treeb69583a61ba780be64ce806c208bc170ff44fa4f /drivers/clk/clk.c
parentf86804af89686562fdeeabbdc0dfc6db9397f202 (diff)
parentbcd6f569e87471d7f104bd9497f0b516a3b12e32 (diff)
Merge branch 'depends/clk' into next/soc
From Mike Turquette: * depends/clk: clk: Common clocks implementation for Versatile Express clk: Versatile Express clock generators ("osc") driver CLK: clk-twl6040: Initial clock driver for OMAP4+ McPDM fclk clock clk: fix return value check in sirfsoc_of_clk_init() clk: fix return value check in of_fixed_clk_setup() clk: ux500: Update sdmmc clock to 100MHz for u8500 clk: ux500: Support prcmu ape opp voltage clock mfd: dbx500: Export prmcu_request_ape_opp_100_voltage clk: Don't return negative numbers for unsigned values with !clk clk: Fix documentation typos clk: Document .is_enabled op clk: SPEAr: Vco-pll: Fix compilation warning
Diffstat (limited to 'drivers/clk/clk.c')
-rw-r--r--drivers/clk/clk.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 56e4495ebeb1..bbe52c4ae7ca 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -261,7 +261,7 @@ inline struct clk_hw *__clk_get_hw(struct clk *clk)
261 261
262inline u8 __clk_get_num_parents(struct clk *clk) 262inline u8 __clk_get_num_parents(struct clk *clk)
263{ 263{
264 return !clk ? -EINVAL : clk->num_parents; 264 return !clk ? 0 : clk->num_parents;
265} 265}
266 266
267inline struct clk *__clk_get_parent(struct clk *clk) 267inline struct clk *__clk_get_parent(struct clk *clk)
@@ -269,14 +269,14 @@ inline struct clk *__clk_get_parent(struct clk *clk)
269 return !clk ? NULL : clk->parent; 269 return !clk ? NULL : clk->parent;
270} 270}
271 271
272inline int __clk_get_enable_count(struct clk *clk) 272inline unsigned int __clk_get_enable_count(struct clk *clk)
273{ 273{
274 return !clk ? -EINVAL : clk->enable_count; 274 return !clk ? 0 : clk->enable_count;
275} 275}
276 276
277inline int __clk_get_prepare_count(struct clk *clk) 277inline unsigned int __clk_get_prepare_count(struct clk *clk)
278{ 278{
279 return !clk ? -EINVAL : clk->prepare_count; 279 return !clk ? 0 : clk->prepare_count;
280} 280}
281 281
282unsigned long __clk_get_rate(struct clk *clk) 282unsigned long __clk_get_rate(struct clk *clk)
@@ -302,15 +302,15 @@ out:
302 302
303inline unsigned long __clk_get_flags(struct clk *clk) 303inline unsigned long __clk_get_flags(struct clk *clk)
304{ 304{
305 return !clk ? -EINVAL : clk->flags; 305 return !clk ? 0 : clk->flags;
306} 306}
307 307
308int __clk_is_enabled(struct clk *clk) 308bool __clk_is_enabled(struct clk *clk)
309{ 309{
310 int ret; 310 int ret;
311 311
312 if (!clk) 312 if (!clk)
313 return -EINVAL; 313 return false;
314 314
315 /* 315 /*
316 * .is_enabled is only mandatory for clocks that gate 316 * .is_enabled is only mandatory for clocks that gate
@@ -323,7 +323,7 @@ int __clk_is_enabled(struct clk *clk)
323 323
324 ret = clk->ops->is_enabled(clk->hw); 324 ret = clk->ops->is_enabled(clk->hw);
325out: 325out:
326 return ret; 326 return !!ret;
327} 327}
328 328
329static struct clk *__clk_lookup_subtree(const char *name, struct clk *clk) 329static struct clk *__clk_lookup_subtree(const char *name, struct clk *clk)
@@ -568,7 +568,7 @@ unsigned long __clk_round_rate(struct clk *clk, unsigned long rate)
568 unsigned long parent_rate = 0; 568 unsigned long parent_rate = 0;
569 569
570 if (!clk) 570 if (!clk)
571 return -EINVAL; 571 return 0;
572 572
573 if (!clk->ops->round_rate) { 573 if (!clk->ops->round_rate) {
574 if (clk->flags & CLK_SET_RATE_PARENT) 574 if (clk->flags & CLK_SET_RATE_PARENT)