Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pcmcia Only try to disestablish the interrupt handle...
details: https://anonhg.NetBSD.org/src/rev/d7b9c9a63dc4
branches: trunk
changeset: 768368:d7b9c9a63dc4
user: dyoung <dyoung%NetBSD.org@localhost>
date: Mon Aug 15 17:01:28 2011 +0000
description:
Only try to disestablish the interrupt handler if the handler was
previously established.
diffstat:
sys/dev/pcmcia/if_wi_pcmcia.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diffs (49 lines):
diff -r e716b86095f4 -r d7b9c9a63dc4 sys/dev/pcmcia/if_wi_pcmcia.c
--- a/sys/dev/pcmcia/if_wi_pcmcia.c Mon Aug 15 15:19:08 2011 +0000
+++ b/sys/dev/pcmcia/if_wi_pcmcia.c Mon Aug 15 17:01:28 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wi_pcmcia.c,v 1.86 2010/11/23 04:33:10 christos Exp $ */
+/* $NetBSD: if_wi_pcmcia.c,v 1.87 2011/08/15 17:01:28 dyoung Exp $ */
/*-
* Copyright (c) 2001, 2004 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wi_pcmcia.c,v 1.86 2010/11/23 04:33:10 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wi_pcmcia.c,v 1.87 2011/08/15 17:01:28 dyoung Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -300,8 +300,10 @@
DELAY(1000);
} else {
pcmcia_function_disable(psc->sc_pf);
- pcmcia_intr_disestablish(psc->sc_pf, sc->sc_ih);
- sc->sc_ih = 0;
+ if (sc->sc_ih != NULL) {
+ pcmcia_intr_disestablish(psc->sc_pf, sc->sc_ih);
+ sc->sc_ih = NULL;
+ }
}
return 0;
@@ -391,6 +393,7 @@
wi_pcmcia_detach(device_t self, int flags)
{
struct wi_pcmcia_softc *psc = device_private(self);
+ struct wi_softc *sc = &psc->sc_wi;
int error;
if (psc->sc_state != WI_PCMCIA_ATTACHED)
@@ -400,6 +403,9 @@
if (error != 0)
return (error);
+ if (sc->sc_ih != NULL)
+ pcmcia_intr_disestablish(psc->sc_pf, sc->sc_ih);
+
pcmcia_function_unconfigure(psc->sc_pf);
return (0);
Home |
Main Index |
Thread Index |
Old Index