summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2014-12-04 07:48:59 +0000
committerBrad Smith <brad@cvs.openbsd.org>2014-12-04 07:48:59 +0000
commit17fad98623f9e72c39e4d7de1b81daa41a3c4c0f (patch)
treee0cef63824e8aedfec546fbb200ad766f584654e /sys
parent506deb516169f97cf7df4d923880ada799ae4145 (diff)
Simplify the MSI bits a bit.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/ahci_pci.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/dev/pci/ahci_pci.c b/sys/dev/pci/ahci_pci.c
index 3d1a7703f45..712376332f8 100644
--- a/sys/dev/pci/ahci_pci.c
+++ b/sys/dev/pci/ahci_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ahci_pci.c,v 1.6 2014/07/10 14:21:20 deraadt Exp $ */
+/* $OpenBSD: ahci_pci.c,v 1.7 2014/12/04 07:48:58 brad Exp $ */
/*
* Copyright (c) 2006 David Gwynne <dlg@openbsd.org>
@@ -328,7 +328,6 @@ ahci_pci_attach(struct device *parent, struct device *self, void *aux)
struct pci_attach_args *pa = aux;
const struct ahci_device *ad;
pci_intr_handle_t ih;
- int mapped = 0;
psc->psc_pc = pa->pa_pc;
psc->psc_tag = pa->pa_tag;
@@ -342,10 +341,10 @@ ahci_pci_attach(struct device *parent, struct device *self, void *aux)
}
}
- if (!(sc->sc_flags & AHCI_F_NO_MSI))
- mapped = pci_intr_map_msi(pa, &ih) != 0 ? 0 : 1;
-
- if (!mapped && pci_intr_map(pa, &ih) != 0) {
+ if (sc->sc_flags & AHCI_F_NO_MSI)
+ pa->pa_flags &= ~PCI_FLAGS_MSI_ENABLED;
+
+ if (pci_intr_map_msi(pa, &ih) != 0 && pci_intr_map(pa, &ih) != 0) {
printf(": unable to map interrupt\n");
return;
}