staging/rdma/hfi1: Use rdmavt device allocation function
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> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
4331629f57
commit
7af6d00654
|
@ -998,13 +998,16 @@ struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, size_t extra)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
struct hfi1_devdata *dd;
|
struct hfi1_devdata *dd;
|
||||||
int ret;
|
int ret, nports;
|
||||||
|
|
||||||
dd = (struct hfi1_devdata *)ib_alloc_device(sizeof(*dd) + extra);
|
/* extra is * number of ports */
|
||||||
|
nports = extra / sizeof(struct hfi1_pportdata);
|
||||||
|
|
||||||
|
dd = (struct hfi1_devdata *)rvt_alloc_device(sizeof(*dd) + extra,
|
||||||
|
nports);
|
||||||
if (!dd)
|
if (!dd)
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
/* extra is * number of ports */
|
dd->num_pports = nports;
|
||||||
dd->num_pports = extra / sizeof(struct hfi1_pportdata);
|
|
||||||
dd->pport = (struct hfi1_pportdata *)(dd + 1);
|
dd->pport = (struct hfi1_pportdata *)(dd + 1);
|
||||||
|
|
||||||
INIT_LIST_HEAD(&dd->list);
|
INIT_LIST_HEAD(&dd->list);
|
||||||
|
|
Loading…
Reference in New Issue