diff mbox

ARM: davinci: clock: return 0 upon error from clk_round_rate()

Message ID alpine.DEB.2.02.1311261653510.11450@tamien (mailing list archive)
State New, archived
Headers show

Commit Message

Paul Walmsley Nov. 27, 2013, 12:56 a.m. UTC
clk_round_rate() should return 0 now upon an error, rather than returning 
a negative error code.  This is because clk_round_rate() is being changed 
to return an unsigned return type rather than a signed type, since some 
clock sources can generate rates higher than (2^31)-1 Hz.

Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Philip Avinash <avinashphilip@ti.com>
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
---
Applies on v3.13-rc1.  See also:

http://marc.info/?l=linux-arm-kernel&m=138542591313620&w=2

  arch/arm/mach-davinci/clock.c |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sekhar Nori Nov. 27, 2013, 9:24 a.m. UTC | #1
On Wednesday 27 November 2013 06:26 AM, Paul Walmsley wrote:
> 
> clk_round_rate() should return 0 now upon an error, rather than
> returning a negative error code.  This is because clk_round_rate() is
> being changed to return an unsigned return type rather than a signed
> type, since some clock sources can generate rates higher than (2^31)-1 Hz.
> 
> Signed-off-by: Paul Walmsley <paul@pwsan.com>
> Cc: Philip Avinash <avinashphilip@ti.com>
> Cc: Sekhar Nori <nsekhar@ti.com>
> Cc: Kevin Hilman <khilman@deeprootsystems.com>

I applied this to my v3.14/soc[1] branch. For some reason I could not
apply the patch to v3.11-rc1 (patch command returns error). Nothing is
obviously worng. Anyway, the change is minor so I made the change manually.

Thanks,
Sekhar

[1]
https://git.kernel.org/cgit/linux/kernel/git/nsekhar/linux-davinci.git/log/?h=v3.14/soc
diff mbox

Patch

diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c
index dc9a470ff9c5..985e5fd00fb2 100644
--- a/arch/arm/mach-davinci/clock.c
+++ b/arch/arm/mach-davinci/clock.c
@@ -133,7 +133,7 @@  EXPORT_SYMBOL(clk_get_rate);
  long clk_round_rate(struct clk *clk, unsigned long rate)
  {
  	if (clk == NULL || IS_ERR(clk))
-		return -EINVAL;
+		return 0;

  	if (clk->round_rate)
  		return clk->round_rate(clk, rate);