Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pcmcia enable the card before trying to establish an...



details:   https://anonhg.NetBSD.org/src/rev/08fd30052721
branches:  trunk
changeset: 519687:08fd30052721
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Dec 24 12:07:27 2001 +0000

description:
enable the card before trying to establish an interrupt because we need the
ccr mapped on multi-function cards.

diffstat:

 sys/dev/pcmcia/com_pcmcia.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (40 lines):

diff -r a7fe4657b1c4 -r 08fd30052721 sys/dev/pcmcia/com_pcmcia.c
--- a/sys/dev/pcmcia/com_pcmcia.c       Mon Dec 24 11:38:06 2001 +0000
+++ b/sys/dev/pcmcia/com_pcmcia.c       Mon Dec 24 12:07:27 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: com_pcmcia.c,v 1.24 2001/12/24 09:30:40 christos Exp $  */
+/*     $NetBSD: com_pcmcia.c,v 1.25 2001/12/24 12:07:27 christos Exp $  */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com_pcmcia.c,v 1.24 2001/12/24 09:30:40 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com_pcmcia.c,v 1.25 2001/12/24 12:07:27 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -326,15 +326,20 @@
 {
        struct com_pcmcia_softc *psc = (struct com_pcmcia_softc *) sc;
        struct pcmcia_function *pf = psc->sc_pf;
+       int error;
+
+       if ((error = com_pcmcia_enable1(sc)) != 0)
+               return error;
 
        /* establish the interrupt. */
        psc->sc_ih = pcmcia_intr_establish(pf, IPL_SERIAL, comintr, sc);
        if (psc->sc_ih == NULL) {
                printf("%s: couldn't establish interrupt\n",
                    sc->sc_dev.dv_xname);
+               com_pcmcia_disable1(sc);
                return 1;
        }
-       return com_pcmcia_enable1(sc);
+       return 0;
 }
 
 int



Home | Main Index | Thread Index | Old Index