summaryrefslogtreecommitdiff
path: root/drivers/clk
diff options
context:
space:
mode:
authorRajendra Nayak <rnayak@ti.com>2012-03-26 17:31:48 +0400
committerMike Turquette <mturquette@linaro.org>2012-04-25 03:37:39 +0400
commit34e44fe87437b6a5aad856f15f7a849e5fc137aa (patch)
tree73b599e531184469cc3478033b82610afbe951f1 /drivers/clk
parentbffad66e31fe9d94cd096f2e4de7c683e1ae32ef (diff)
downloadlinux-34e44fe87437b6a5aad856f15f7a849e5fc137aa.tar.xz
clk: Make clk_get_rate() return 0 on error
Most users of clk_get_rate() actually assume a non zero return value as a valid rate returned. Returing -EINVAL might confuse such users, so make it instead return zero on error. Besides the return value of clk_get_rate seems to be 'unsigned long'. Signed-off-by: Rajendra nayak <rnayak@ti.com> Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/clk.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 9924aec17aad..a24b121747ac 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -285,7 +285,7 @@ unsigned long __clk_get_rate(struct clk *clk)
unsigned long ret;
if (!clk) {
- ret = -EINVAL;
+ ret = 0;
goto out;
}
@@ -295,7 +295,7 @@ unsigned long __clk_get_rate(struct clk *clk)
goto out;
if (!clk->parent)
- ret = -ENODEV;
+ ret = 0;
out:
return ret;
@@ -560,7 +560,7 @@ EXPORT_SYMBOL_GPL(clk_enable);
* @clk: the clk whose rate is being returned
*
* Simply returns the cached rate of the clk. Does not query the hardware. If
- * clk is NULL then returns -EINVAL.
+ * clk is NULL then returns 0.
*/
unsigned long clk_get_rate(struct clk *clk)
{