aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_driver.c')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_driver.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c
index 765f0fc1da76..be24ac726114 100644
--- a/drivers/infiniband/hw/ipath/ipath_driver.c
+++ b/drivers/infiniband/hw/ipath/ipath_driver.c
@@ -199,12 +199,11 @@ static struct ipath_devdata *ipath_alloc_devdata(struct pci_dev *pdev)
199 goto bail; 199 goto bail;
200 } 200 }
201 201
202 dd = vmalloc(sizeof(*dd)); 202 dd = vzalloc(sizeof(*dd));
203 if (!dd) { 203 if (!dd) {
204 dd = ERR_PTR(-ENOMEM); 204 dd = ERR_PTR(-ENOMEM);
205 goto bail; 205 goto bail;
206 } 206 }
207 memset(dd, 0, sizeof(*dd));
208 dd->ipath_unit = -1; 207 dd->ipath_unit = -1;
209 208
210 spin_lock_irqsave(&ipath_devs_lock, flags); 209 spin_lock_irqsave(&ipath_devs_lock, flags);
@@ -399,7 +398,6 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
399 struct ipath_devdata *dd; 398 struct ipath_devdata *dd;
400 unsigned long long addr; 399 unsigned long long addr;
401 u32 bar0 = 0, bar1 = 0; 400 u32 bar0 = 0, bar1 = 0;
402 u8 rev;
403 401
404 dd = ipath_alloc_devdata(pdev); 402 dd = ipath_alloc_devdata(pdev);
405 if (IS_ERR(dd)) { 403 if (IS_ERR(dd)) {
@@ -530,9 +528,8 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
530 for (j = 0; j < 6; j++) { 528 for (j = 0; j < 6; j++) {
531 if (!pdev->resource[j].start) 529 if (!pdev->resource[j].start)
532 continue; 530 continue;
533 ipath_cdbg(VERBOSE, "BAR %d start %llx, end %llx, len %llx\n", 531 ipath_cdbg(VERBOSE, "BAR %d %pR, len %llx\n",
534 j, (unsigned long long)pdev->resource[j].start, 532 j, &pdev->resource[j],
535 (unsigned long long)pdev->resource[j].end,
536 (unsigned long long)pci_resource_len(pdev, j)); 533 (unsigned long long)pci_resource_len(pdev, j));
537 } 534 }
538 535
@@ -542,13 +539,7 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
542 goto bail_regions; 539 goto bail_regions;
543 } 540 }
544 541
545 ret = pci_read_config_byte(pdev, PCI_REVISION_ID, &rev); 542 dd->ipath_pcirev = pdev->revision;
546 if (ret) {
547 ipath_dev_err(dd, "Failed to read PCI revision ID unit "
548 "%u: err %d\n", dd->ipath_unit, -ret);
549 goto bail_regions; /* shouldn't ever happen */
550 }
551 dd->ipath_pcirev = rev;
552 543
553#if defined(__powerpc__) 544#if defined(__powerpc__)
554 /* There isn't a generic way to specify writethrough mappings */ 545 /* There isn't a generic way to specify writethrough mappings */
@@ -757,7 +748,7 @@ static void __devexit ipath_remove_one(struct pci_dev *pdev)
757 */ 748 */
758 ipath_shutdown_device(dd); 749 ipath_shutdown_device(dd);
759 750
760 flush_scheduled_work(); 751 flush_workqueue(ib_wq);
761 752
762 if (dd->verbs_dev) 753 if (dd->verbs_dev)
763 ipath_unregister_ib_device(dd->verbs_dev); 754 ipath_unregister_ib_device(dd->verbs_dev);
@@ -2394,7 +2385,7 @@ void ipath_shutdown_device(struct ipath_devdata *dd)
2394 /* 2385 /*
2395 * clear SerdesEnable and turn the leds off; do this here because 2386 * clear SerdesEnable and turn the leds off; do this here because
2396 * we are unloading, so don't count on interrupts to move along 2387 * we are unloading, so don't count on interrupts to move along
2397 * Turn the LEDs off explictly for the same reason. 2388 * Turn the LEDs off explicitly for the same reason.
2398 */ 2389 */
2399 dd->ipath_f_quiet_serdes(dd); 2390 dd->ipath_f_quiet_serdes(dd);
2400 2391