summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_ral_pci.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-12-04 22:26:56 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-12-04 22:26:56 +0000
commit5cbc5dc1bbfc5e16afd43ddaaaa3f5799ba0dda8 (patch)
tree832000cc585532d7bff1ddba3d45d7fe4637567d /sys/dev/pci/if_ral_pci.c
parenta0a521cc6fec5a389d3004997e1a5b83fbe34712 (diff)
expresscard ral(4) rt2860 now can attach and detach correctly
ok kettenis
Diffstat (limited to 'sys/dev/pci/if_ral_pci.c')
-rw-r--r--sys/dev/pci/if_ral_pci.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/sys/dev/pci/if_ral_pci.c b/sys/dev/pci/if_ral_pci.c
index 0a398bc5eea..370f05763e7 100644
--- a/sys/dev/pci/if_ral_pci.c
+++ b/sys/dev/pci/if_ral_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ral_pci.c,v 1.10 2007/11/15 21:40:47 deraadt Exp $ */
+/* $OpenBSD: if_ral_pci.c,v 1.11 2007/12/04 22:26:54 deraadt Exp $ */
/*-
* Copyright (c) 2005-2007
@@ -186,9 +186,19 @@ ral_pci_detach(struct device *self, int flags)
{
struct ral_pci_softc *psc = (struct ral_pci_softc *)self;
struct rt2560_softc *sc = &psc->sc_sc;
+ int error;
+
+ error = (*psc->sc_opns->detach)(sc);
+ if (error != 0)
+ return error;
+
+ if (psc->sc_ih != NULL) {
+ pci_intr_disestablish(psc->sc_pc, psc->sc_ih);
+ psc->sc_ih = NULL;
+ }
- (*psc->sc_opns->detach)(sc);
- pci_intr_disestablish(psc->sc_pc, psc->sc_ih);
+ if (psc->sc_mapsize > 0)
+ bus_space_unmap(sc->sc_st, sc->sc_sh, psc->sc_mapsize);
return 0;
}