IB/qib: Use rdmavt device allocation function
authorDennis Dalessandro <dennis.dalessandro@intel.com>
Fri, 22 Jan 2016 21:07:23 +0000 (13:07 -0800)
committerDoug Ledford <dledford@redhat.com>
Fri, 11 Mar 2016 01:37:28 +0000 (20:37 -0500)
No longer do drivers need to call into the IB core to allocate the verbs
device.  Use the functionality provided by rdmavt.

Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Harish Chegondi <harish.chegondi@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/qib/qib_init.c

index 5087a1f808c089329ac8da15b54e90981074af19..a3c74bb4df62fbbccad141a4ab000b90925a8d5d 100644 (file)
@@ -1131,9 +1131,12 @@ struct qib_devdata *qib_alloc_devdata(struct pci_dev *pdev, size_t extra)
 {
        unsigned long flags;
        struct qib_devdata *dd;
-       int ret;
+       int ret, nports;
 
-       dd = (struct qib_devdata *) ib_alloc_device(sizeof(*dd) + extra);
+       /* extra is * number of ports */
+       nports = extra / sizeof(struct qib_pportdata);
+       dd = (struct qib_devdata *)rvt_alloc_device(sizeof(*dd) + extra,
+                                                   nports);
        if (!dd)
                return ERR_PTR(-ENOMEM);