aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/mthca/mthca_provider.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2019-06-05 14:39:24 -0300
committerJason Gunthorpe <jgg@mellanox.com>2019-06-10 16:56:02 -0300
commitb9560a419bfd498279333387817adcf5faef2825 (patch)
tree6ebfe84162f6a44856fe910c2c54ed535d6bf81e /drivers/infiniband/hw/mthca/mthca_provider.c
parentrdma: Delete the ib_ucm module (diff)
downloadlinux-dev-b9560a419bfd498279333387817adcf5faef2825.tar.xz
linux-dev-b9560a419bfd498279333387817adcf5faef2825.zip
RDMA: Move driver_id into struct ib_device_ops
No reason for every driver to emit code to set this, just make it part of the driver's existing static const ops structure. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Reviewed-by: Leon Romanovsky <leonro@mellanox.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_provider.c')
-rw-r--r--drivers/infiniband/hw/mthca/mthca_provider.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c b/drivers/infiniband/hw/mthca/mthca_provider.c
index 4f40dfedf920..d6467da39aab 100644
--- a/drivers/infiniband/hw/mthca/mthca_provider.c
+++ b/drivers/infiniband/hw/mthca/mthca_provider.c
@@ -1153,6 +1153,8 @@ static void get_dev_fw_str(struct ib_device *device, char *str)
}
static const struct ib_device_ops mthca_dev_ops = {
+ .driver_id = RDMA_DRIVER_MTHCA,
+
.alloc_pd = mthca_alloc_pd,
.alloc_ucontext = mthca_alloc_ucontext,
.attach_mcast = mthca_multicast_attach,
@@ -1303,7 +1305,6 @@ int mthca_register_device(struct mthca_dev *dev)
mutex_init(&dev->cap_mask_mutex);
rdma_set_device_sysfs_group(&dev->ib_dev, &mthca_attr_group);
- dev->ib_dev.driver_id = RDMA_DRIVER_MTHCA;
ret = ib_register_device(&dev->ib_dev, "mthca%d");
if (ret)
return ret;