summaryrefslogtreecommitdiffstats
path: root/sys/dev/firewire/fwohci_pci.c
diff options
context:
space:
mode:
authorsimokawa <simokawa@FreeBSD.org>2007-03-30 22:25:26 +0000
committersimokawa <simokawa@FreeBSD.org>2007-03-30 22:25:26 +0000
commit9ccf8975f6660970c9f012567788903111775c39 (patch)
treeff08fc791351e631a83817e9b59a0f7fdbdb8c9a /sys/dev/firewire/fwohci_pci.c
parent673ad56aaea7fe3a8bd58e125efe48850c8c32f8 (diff)
downloadFreeBSD-src-9ccf8975f6660970c9f012567788903111775c39.zip
FreeBSD-src-9ccf8975f6660970c9f012567788903111775c39.tar.gz
Teardown interrupt only when sc->ih is not NULL.
MFC after: 3 days
Diffstat (limited to 'sys/dev/firewire/fwohci_pci.c')
-rw-r--r--sys/dev/firewire/fwohci_pci.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/sys/dev/firewire/fwohci_pci.c b/sys/dev/firewire/fwohci_pci.c
index d3224a0..ddc4f48 100644
--- a/sys/dev/firewire/fwohci_pci.c
+++ b/sys/dev/firewire/fwohci_pci.c
@@ -424,19 +424,18 @@ fwohci_pci_detach(device_t self)
FWOHCI_INTMASKCLR, OHCI_INT_EN);
if (sc->irq_res) {
- int err = bus_teardown_intr(self, sc->irq_res, sc->ih);
- if (err)
- /* XXX or should we panic? */
- device_printf(self, "Could not tear down irq, %d\n",
- err);
+ int err;
+ if (sc->ih) {
+ err = bus_teardown_intr(self, sc->irq_res, sc->ih);
+ if (err)
+ device_printf(self,
+ "Could not tear down irq, %d\n", err);
#if defined(__DragonFly__) || __FreeBSD_version < 500000
- bus_teardown_intr(self, sc->irq_res, sc->ih_cam);
- bus_teardown_intr(self, sc->irq_res, sc->ih_bio);
+ bus_teardown_intr(self, sc->irq_res, sc->ih_cam);
+ bus_teardown_intr(self, sc->irq_res, sc->ih_bio);
#endif
- sc->ih = NULL;
- }
-
- if (sc->irq_res) {
+ sc->ih = NULL;
+ }
bus_release_resource(self, SYS_RES_IRQ, 0, sc->irq_res);
sc->irq_res = NULL;
}
OpenPOWER on IntegriCloud