aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@pathscale.com>2006-09-28 09:00:01 -0700
committerRoland Dreier <rolandd@cisco.com>2006-09-28 11:16:29 -0700
commitc78f6415e964aafd3a91d834970c16b613e421d9 (patch)
tree0c12248b84ed15f5c49cce6a9160facf3feab82f /drivers/infiniband/hw/ipath
parentIB/ipath: Support revision 2 InfiniPath PCIE devices (diff)
downloadlinux-dev-c78f6415e964aafd3a91d834970c16b613e421d9.tar.xz
linux-dev-c78f6415e964aafd3a91d834970c16b613e421d9.zip
IB/ipath: Unregister from IB core early
This gives upper-level protocols a chance to unregister while the device is still usable. Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_driver.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c
index 0fe37c5467ac..a260acf4a9e6 100644
--- a/drivers/infiniband/hw/ipath/ipath_driver.c
+++ b/drivers/infiniband/hw/ipath/ipath_driver.c
@@ -536,7 +536,12 @@ static void __devexit ipath_remove_one(struct pci_dev *pdev)
return;
dd = pci_get_drvdata(pdev);
- ipath_unregister_ib_device(dd->verbs_dev);
+
+ if (dd->verbs_dev) {
+ ipath_unregister_ib_device(dd->verbs_dev);
+ dd->verbs_dev = NULL;
+ }
+
ipath_diag_remove(dd);
ipath_user_remove(dd);
ipathfs_remove_device(dd);
@@ -2027,6 +2032,11 @@ static void __exit infinipath_cleanup(void)
list_for_each_entry_safe(dd, tmp, &ipath_dev_list, ipath_list) {
spin_unlock_irqrestore(&ipath_devs_lock, flags);
+ if (dd->verbs_dev) {
+ ipath_unregister_ib_device(dd->verbs_dev);
+ dd->verbs_dev = NULL;
+ }
+
if (dd->ipath_kregbase)
cleanup_device(dd);