From: Dennis Dalessandro Date: Tue, 19 Jan 2016 22:44:06 +0000 (-0800) Subject: staging/rdma/hfi1: Use rdmavt device allocation function X-Git-Tag: v5.15~13951^2^3~178 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7af6d00654a16ca805f50e05eebb545ef9dbb016;p=platform%2Fkernel%2Flinux-starfive.git 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 Signed-off-by: Dennis Dalessandro Signed-off-by: Doug Ledford --- diff --git a/drivers/staging/rdma/hfi1/init.c b/drivers/staging/rdma/hfi1/init.c index d1cb2c8..7def3f3 100644 --- a/drivers/staging/rdma/hfi1/init.c +++ b/drivers/staging/rdma/hfi1/init.c @@ -998,13 +998,16 @@ struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, size_t extra) { unsigned long flags; struct hfi1_devdata *dd; - int ret; + int ret, nports; + + /* extra is * number of ports */ + nports = extra / sizeof(struct hfi1_pportdata); - dd = (struct hfi1_devdata *)ib_alloc_device(sizeof(*dd) + extra); + dd = (struct hfi1_devdata *)rvt_alloc_device(sizeof(*dd) + extra, + nports); if (!dd) return ERR_PTR(-ENOMEM); - /* extra is * number of ports */ - dd->num_pports = extra / sizeof(struct hfi1_pportdata); + dd->num_pports = nports; dd->pport = (struct hfi1_pportdata *)(dd + 1); INIT_LIST_HEAD(&dd->list);