summaryrefslogtreecommitdiffstats
path: root/sys/dev/ata
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2003-02-25 14:46:30 +0000
committersos <sos@FreeBSD.org>2003-02-25 14:46:30 +0000
commit951fcfa2386ce765b364a819150fa48e20cd3d47 (patch)
treee56afcf1df5e9b2af5c234eef12de8a45f8c8445 /sys/dev/ata
parenta7797208dc47f031e7f3b2a3b5be39ebea40f836 (diff)
downloadFreeBSD-src-951fcfa2386ce765b364a819150fa48e20cd3d47.zip
FreeBSD-src-951fcfa2386ce765b364a819150fa48e20cd3d47.tar.gz
Properly teardown the interrupt so we wont panic on detach.
Diffstat (limited to 'sys/dev/ata')
-rw-r--r--sys/dev/ata/ata-pci.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/sys/dev/ata/ata-pci.c b/sys/dev/ata/ata-pci.c
index 065e0b0..01f2527 100644
--- a/sys/dev/ata/ata-pci.c
+++ b/sys/dev/ata/ata-pci.c
@@ -363,13 +363,13 @@ ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq,
#endif
}
else {
- struct ata_pci_controller *controller = device_get_softc(dev);
- int unit = ((struct ata_channel *)device_get_softc(child))->unit;
+ struct ata_pci_controller *controller = device_get_softc(dev);
+ int unit = ((struct ata_channel *)device_get_softc(child))->unit;
- controller->interrupt[unit].function = function;
- controller->interrupt[unit].argument = argument;
- *cookiep = controller;
- return 0;
+ controller->interrupt[unit].function = function;
+ controller->interrupt[unit].argument = argument;
+ *cookiep = controller;
+ return 0;
}
}
@@ -384,8 +384,14 @@ ata_pci_teardown_intr(device_t dev, device_t child, struct resource *irq,
return BUS_TEARDOWN_INTR(device_get_parent(dev), child, irq, cookie);
#endif
}
- else
+ else {
+ struct ata_pci_controller *controller = device_get_softc(dev);
+ int unit = ((struct ata_channel *)device_get_softc(child))->unit;
+
+ controller->interrupt[unit].function = NULL;
+ controller->interrupt[unit].argument = NULL;
return 0;
+ }
}
static void
OpenPOWER on IntegriCloud