Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7-0]: src/sys/arch/arm/allwinner Pull up following revision(s) (r...



details:   https://anonhg.NetBSD.org/src/rev/2cb66a350420
branches:  netbsd-7-0
changeset: 801064:2cb66a350420
user:      riz <riz%NetBSD.org@localhost>
date:      Sat Nov 07 16:14:37 2015 +0000

description:
Pull up following revision(s) (requested by bouyer in ticket #1006):
        sys/arch/arm/allwinner/awin_mmc.c: revision 1.22
Avoid a divide by 0 when unplugging a sd card.

diffstat:

 sys/arch/arm/allwinner/awin_mmc.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 15235207d0fc -r 2cb66a350420 sys/arch/arm/allwinner/awin_mmc.c
--- a/sys/arch/arm/allwinner/awin_mmc.c Thu Nov 05 09:35:43 2015 +0000
+++ b/sys/arch/arm/allwinner/awin_mmc.c Sat Nov 07 16:14:37 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_mmc.c,v 1.3.10.3 2014/12/04 11:08:38 martin Exp $ */
+/* $NetBSD: awin_mmc.c,v 1.3.10.3.2.1 2015/11/07 16:14:37 riz Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -29,7 +29,7 @@
 #include "locators.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: awin_mmc.c,v 1.3.10.3 2014/12/04 11:08:38 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awin_mmc.c,v 1.3.10.3.2.1 2015/11/07 16:14:37 riz Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -510,7 +510,10 @@
                sdly = awin_chip_id() == AWIN_CHIP_ID_A31 ? 0 : 7;
                clksrc = AWIN_SD_CLK_SRC_SEL_OSC24M;
                n = 2;
-               m = ((osc24m_freq / (1 << n)) / freq) - 1;
+               if (freq > 0)
+                       m = ((osc24m_freq / (1 << n)) / freq) - 1;
+               else
+                       m = 15;
        } else if (freq <= 25000) {
                odly = 0;
                sdly = 5;



Home | Main Index | Thread Index | Old Index