Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pcmcia Fix a slight buglet in `enable' magic odering...



details:   https://anonhg.NetBSD.org/src/rev/359834a25060
branches:  trunk
changeset: 476816:359834a25060
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Tue Sep 28 22:46:43 1999 +0000

description:
Fix a slight buglet in `enable' magic odering, point out by
Chuck Cranor.

diffstat:

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

diffs (40 lines):

diff -r 5c866aeda87b -r 359834a25060 sys/dev/pcmcia/mhzc.c
--- a/sys/dev/pcmcia/mhzc.c     Tue Sep 28 21:56:45 1999 +0000
+++ b/sys/dev/pcmcia/mhzc.c     Tue Sep 28 22:46:43 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mhzc.c,v 1.1 1999/09/28 17:58:55 thorpej Exp $ */
+/*     $NetBSD: mhzc.c,v 1.2 1999/09/28 22:46:43 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -464,13 +464,6 @@
        }
 
        /*
-        * Perform any special enable magic necessary.
-        */
-       if (sc->sc_product->mp_enable != NULL &&
-           (*sc->sc_product->mp_enable)(sc) != 0)
-               return (1);
-
-       /*
         * Establish our interrupt handler.
         *
         * XXX Note, we establish this at IPL_NET.  This is suboptimal
@@ -493,6 +486,16 @@
                return (1);
        }
 
+       /*
+        * Perform any special enable magic necessary.
+        */
+       if (sc->sc_product->mp_enable != NULL &&
+           (*sc->sc_product->mp_enable)(sc) != 0) {
+               pcmcia_function_disable(sc->sc_pf);
+               pcmcia_intr_disestablish(sc->sc_pf, sc->sc_ih);
+               return (1);
+       }
+
        sc->sc_flags |= flag;
        return (0);
 }



Home | Main Index | Thread Index | Old Index