diff options
-rw-r--r-- | sys/dev/cardbus/if_re_cardbus.c | 12 | ||||
-rw-r--r-- | sys/dev/pci/if_re_pci.c | 7 |
2 files changed, 15 insertions, 4 deletions
diff --git a/sys/dev/cardbus/if_re_cardbus.c b/sys/dev/cardbus/if_re_cardbus.c index 86ba66db2fd..7ab67814f24 100644 --- a/sys/dev/cardbus/if_re_cardbus.c +++ b/sys/dev/cardbus/if_re_cardbus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_re_cardbus.c,v 1.13 2008/04/20 00:34:39 brad Exp $ */ +/* $OpenBSD: if_re_cardbus.c,v 1.14 2008/10/12 00:54:49 brad Exp $ */ /* * Copyright (c) 2005 Peter Valchev <pvalchev@openbsd.org> @@ -163,7 +163,15 @@ re_cardbus_attach(struct device *parent, struct device *self, void *aux) sc->sc_pwrhook = powerhook_establish(re_cardbus_powerhook, sc); /* Call bus-independent (common) attach routine */ - re_attach(sc, intrstr); + if (re_attach(sc, intrstr)) { + if (sc->sc_sdhook != NULL) + shutdownhook_disestablish(sc->sc_sdhook); + if (sc->sc_pwrhook != NULL) + powerhook_disestablish(sc->sc_pwrhook); + cardbus_intr_disestablish(ct->ct_cc, ct->ct_cf, csc->sc_ih); + Cardbus_mapreg_unmap(ct, csc->sc_bar_reg, sc->rl_btag, + sc->rl_bhandle, csc->sc_mapsize); + } } /* diff --git a/sys/dev/pci/if_re_pci.c b/sys/dev/pci/if_re_pci.c index db822c3285b..f4dfcfaa227 100644 --- a/sys/dev/pci/if_re_pci.c +++ b/sys/dev/pci/if_re_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_re_pci.c,v 1.22 2008/10/05 22:32:11 brad Exp $ */ +/* $OpenBSD: if_re_pci.c,v 1.23 2008/10/12 00:54:49 brad Exp $ */ /* * Copyright (c) 2005 Peter Valchev <pvalchev@openbsd.org> @@ -195,5 +195,8 @@ re_pci_attach(struct device *parent, struct device *self, void *aux) sc->rl_flags |= RL_FLAG_PCIE; /* Call bus-independent attach routine */ - re_attach(sc, intrstr); + if (re_attach(sc, intrstr)) { + pci_intr_disestablish(pc, psc->sc_ih); + bus_space_unmap(sc->rl_btag, sc->rl_bhandle, iosize); + } } |