Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/allwinner establish intr handler before calling...



details:   https://anonhg.NetBSD.org/src/rev/107620012b0b
branches:  trunk
changeset: 789706:107620012b0b
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Wed Sep 04 09:14:57 2013 +0000

description:
establish intr handler before calling sdhc_host_found

diffstat:

 sys/arch/arm/allwinner/awin_sdhc.c |  23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diffs (56 lines):

diff -r 74fd91e1f165 -r 107620012b0b sys/arch/arm/allwinner/awin_sdhc.c
--- a/sys/arch/arm/allwinner/awin_sdhc.c        Wed Sep 04 09:09:25 2013 +0000
+++ b/sys/arch/arm/allwinner/awin_sdhc.c        Wed Sep 04 09:14:57 2013 +0000
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: awin_sdhc.c,v 1.1 2013/09/04 02:39:01 matt Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_sdhc.c,v 1.2 2013/09/04 09:14:57 jmcneill Exp $");
 
 #include <sys/bus.h>
 #include <sys/device.h>
@@ -85,6 +85,7 @@
        struct sdhc_softc * const sc = &asc->asc_sc;
        struct awinio_attach_args * const aio = aux;
        const struct awin_locators * const loc = &aio->aio_loc;
+       int error;
 
        awinsdhc_ports |= __BIT(loc->loc_port);
        asc->asc_bst = aio->aio_core_bst;
@@ -102,16 +103,6 @@
        aprint_normal(": SDHC controller%s\n",
           (sc->sc_flags & SDHC_FLAG_USE_DMA) ? " (DMA enabled)" : "");
 
-#if 1
-       int error = sdhc_host_found(sc, asc->asc_bst, asc->asc_bsh,
-           loc->loc_size);
-       if (error != 0) {
-               aprint_error_dev(self, "couldn't initialize host, error=%d\n",
-                   error);
-               goto fail;
-       }
-#endif
-
        asc->asc_ih = intr_establish(loc->loc_intr, IPL_VM, IST_LEVEL,
            sdhc_intr, sc);
        if (asc->asc_ih == NULL) {
@@ -122,9 +113,17 @@
        aprint_normal_dev(self, "interrupting on irq %d\n",
             loc->loc_intr);
 
-       return;
+       error = sdhc_host_found(sc, asc->asc_bst, asc->asc_bsh,
+           loc->loc_size);
+       if (error != 0) {
+               aprint_error_dev(self, "couldn't initialize host, error=%d\n",
+                   error);
+               goto fail;
+       }
 
+       return;
 fail:
+
        if (asc->asc_ih) {
                intr_disestablish(asc->asc_ih);
                asc->asc_ih = NULL;



Home | Main Index | Thread Index | Old Index