public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: mach-shmobile: sh7372 divide-by-zero FSIDIV fix
@ 2011-06-09  6:49 Magnus Damm
  2011-06-10  2:23 ` Simon Horman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Magnus Damm @ 2011-06-09  6:49 UTC (permalink / raw)
  To: linux-sh

From: Magnus Damm <damm@opensource.se>

Update the sh7372 FSIDIV clock code to bail out
with -EINVAL in case of rate is zero.

Without this fix divide-by-zero is triggering
on sh7372 platforms during system wide resume
of Suspend-to-RAM.

Signed-off-by: Magnus Damm <damm@opensource.se>
---

 arch/arm/mach-shmobile/clock-sh7372.c |    3 +++
 1 file changed, 3 insertions(+)

--- 0001/arch/arm/mach-shmobile/clock-sh7372.c
+++ work/arch/arm/mach-shmobile/clock-sh7372.c	2011-06-09 15:45:41.000000000 +0900
@@ -460,6 +460,9 @@ static int fsidiv_set_rate(struct clk *c
 {
 	int idx;
 
+	if (!rate)
+		return -EINVAL;
+
 	idx = (clk->parent->rate / rate) & 0xffff;
 	if (idx < 2)
 		return -EINVAL;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-10  6:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-09  6:49 [PATCH] ARM: mach-shmobile: sh7372 divide-by-zero FSIDIV fix Magnus Damm
2011-06-10  2:23 ` Simon Horman
2011-06-10  4:54 ` Magnus Damm
2011-06-10  6:01 ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox