Skip to content

Commit 16b0ba9

Browse files
Kamalheibjgunthorpe
authored andcommitted
RDMA/qib: Initialize ib_device_ops struct
Initialize ib_device_ops with the supported operations using ib_set_device_ops(). Signed-off-by: Kamal Heib <kamalheib1@gmail.com> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
1 parent bd59461 commit 16b0ba9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/infiniband/hw/qib/qib_verbs.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1493,6 +1493,11 @@ static void qib_fill_device_attr(struct qib_devdata *dd)
14931493
dd->verbs_dev.rdi.wc_opcode = ib_qib_wc_opcode;
14941494
}
14951495

1496+
static const struct ib_device_ops qib_dev_ops = {
1497+
.modify_device = qib_modify_device,
1498+
.process_mad = qib_process_mad,
1499+
};
1500+
14961501
/**
14971502
* qib_register_ib_device - register our device with the infiniband core
14981503
* @dd: the device data structure
@@ -1555,8 +1560,6 @@ int qib_register_ib_device(struct qib_devdata *dd)
15551560
ibdev->node_guid = ppd->guid;
15561561
ibdev->phys_port_cnt = dd->num_pports;
15571562
ibdev->dev.parent = &dd->pcidev->dev;
1558-
ibdev->modify_device = qib_modify_device;
1559-
ibdev->process_mad = qib_process_mad;
15601563

15611564
snprintf(ibdev->node_desc, sizeof(ibdev->node_desc),
15621565
"Intel Infiniband HCA %s", init_utsname()->nodename);
@@ -1624,6 +1627,7 @@ int qib_register_ib_device(struct qib_devdata *dd)
16241627
}
16251628
rdma_set_device_sysfs_group(&dd->verbs_dev.rdi.ibdev, &qib_attr_group);
16261629

1630+
ib_set_device_ops(ibdev, &qib_dev_ops);
16271631
ret = rvt_register_device(&dd->verbs_dev.rdi, RDMA_DRIVER_QIB);
16281632
if (ret)
16291633
goto err_tx;

0 commit comments

Comments
 (0)