Commit 915e4af5 authored by Jason Gunthorpe's avatar Jason Gunthorpe
Browse files

RDMA: Remove rdma_set_device_sysfs_group()

The driver's device group can be specified as part of the ops structure
like the device's port group. No need for the complicated API.

Link: https://lore.kernel.org/r/8964785a34fd3a29ff5b6693493f575b717e594d.1623427137.git.leonro@nvidia.com


Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 69d86a66
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -586,7 +586,6 @@ struct ib_device *_ib_alloc_device(size_t size)
		return NULL;
	}

	device->groups[0] = &ib_dev_attr_group;
	rdma_init_coredev(&device->coredev, device, &init_net);

	INIT_LIST_HEAD(&device->event_handler_list);
@@ -1396,6 +1395,8 @@ int ib_register_device(struct ib_device *device, const char *name,
		return ret;
	}

	device->groups[0] = &ib_dev_attr_group;
	device->groups[1] = device->ops.device_group;
	ret = ib_setup_device_attrs(device);
	if (ret)
		goto cache_cleanup;
@@ -2643,6 +2644,7 @@ void ib_set_device_ops(struct ib_device *dev, const struct ib_device_ops *ops)
	SET_DEVICE_OP(dev_ops, destroy_rwq_ind_table);
	SET_DEVICE_OP(dev_ops, destroy_srq);
	SET_DEVICE_OP(dev_ops, destroy_wq);
	SET_DEVICE_OP(dev_ops, device_group);
	SET_DEVICE_OP(dev_ops, detach_mcast);
	SET_DEVICE_OP(dev_ops, disassociate_ucontext);
	SET_DEVICE_OP(dev_ops, drain_rq);
+1 −1
Original line number Diff line number Diff line
@@ -683,6 +683,7 @@ static const struct ib_device_ops bnxt_re_dev_ops = {
	.destroy_cq = bnxt_re_destroy_cq,
	.destroy_qp = bnxt_re_destroy_qp,
	.destroy_srq = bnxt_re_destroy_srq,
	.device_group = &bnxt_re_dev_attr_group,
	.get_dev_fw_str = bnxt_re_query_fw_str,
	.get_dma_mr = bnxt_re_get_dma_mr,
	.get_hw_stats = bnxt_re_ib_get_hw_stats,
@@ -729,7 +730,6 @@ static int bnxt_re_register_ib(struct bnxt_re_dev *rdev)
	ibdev->dev.parent = &rdev->en_dev->pdev->dev;
	ibdev->local_dma_lkey = BNXT_QPLIB_RSVD_LKEY;

	rdma_set_device_sysfs_group(ibdev, &bnxt_re_dev_attr_group);
	ib_set_device_ops(ibdev, &bnxt_re_dev_ops);
	ret = ib_device_set_netdev(&rdev->ibdev, rdev->netdev, 1);
	if (ret)
+1 −1
Original line number Diff line number Diff line
@@ -465,6 +465,7 @@ static const struct ib_device_ops c4iw_dev_ops = {
	.destroy_cq = c4iw_destroy_cq,
	.destroy_qp = c4iw_destroy_qp,
	.destroy_srq = c4iw_destroy_srq,
	.device_group = &c4iw_attr_group,
	.fill_res_cq_entry = c4iw_fill_res_cq_entry,
	.fill_res_cm_id_entry = c4iw_fill_res_cm_id_entry,
	.fill_res_mr_entry = c4iw_fill_res_mr_entry,
@@ -539,7 +540,6 @@ void c4iw_register_device(struct work_struct *work)
	memcpy(dev->ibdev.iw_ifname, dev->rdev.lldi.ports[0]->name,
	       sizeof(dev->ibdev.iw_ifname));

	rdma_set_device_sysfs_group(&dev->ibdev, &c4iw_attr_group);
	ib_set_device_ops(&dev->ibdev, &c4iw_dev_ops);
	ret = set_netdevs(&dev->ibdev, &dev->rdev);
	if (ret)
+1 −3
Original line number Diff line number Diff line
@@ -1789,6 +1789,7 @@ static const struct ib_device_ops hfi1_dev_ops = {
	.alloc_hw_device_stats = hfi1_alloc_hw_device_stats,
	.alloc_hw_port_stats = hfi_alloc_hw_port_stats,
	.alloc_rdma_netdev = hfi1_vnic_alloc_rn,
	.device_group = &ib_hfi1_attr_group,
	.get_dev_fw_str = hfi1_get_dev_fw_str,
	.get_hw_stats = get_hw_stats,
	.modify_device = modify_device,
@@ -1927,9 +1928,6 @@ int hfi1_register_ib_device(struct hfi1_devdata *dd)
			      i,
			      ppd->pkeys);

	rdma_set_device_sysfs_group(&dd->verbs_dev.rdi.ibdev,
				    &ib_hfi1_attr_group);

	ret = rvt_register_device(&dd->verbs_dev.rdi);
	if (ret)
		goto err_verbs_txreq;
+1 −1
Original line number Diff line number Diff line
@@ -2547,6 +2547,7 @@ static const struct ib_device_ops mlx4_ib_dev_ops = {
	.destroy_qp = mlx4_ib_destroy_qp,
	.destroy_srq = mlx4_ib_destroy_srq,
	.detach_mcast = mlx4_ib_mcg_detach,
	.device_group = &mlx4_attr_group,
	.disassociate_ucontext = mlx4_ib_disassociate_ucontext,
	.drain_rq = mlx4_ib_drain_rq,
	.drain_sq = mlx4_ib_drain_sq,
@@ -2806,7 +2807,6 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
	if (mlx4_ib_alloc_diag_counters(ibdev))
		goto err_steer_free_bitmap;

	rdma_set_device_sysfs_group(&ibdev->ib_dev, &mlx4_attr_group);
	if (ib_register_device(&ibdev->ib_dev, "mlx4_%d",
			       &dev->persist->pdev->dev))
		goto err_diag_counters;
Loading