Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 896de009 authored by Jason Gunthorpe's avatar Jason Gunthorpe
Browse files

RDMA/core: Use dev_name instead of ibdev->name



These return the same thing but dev_name is a more conventional use of the
kernel API.

Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
Reviewed-by: default avatarSteve Wise <swise@opengridcomputing.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@mellanox.com>
Reviewed-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
parent 5a738b5d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4367,7 +4367,7 @@ static void cm_add_one(struct ib_device *ib_device)
	cm_dev->going_down = 0;
	cm_dev->device = device_create(&cm_class, &ib_device->dev,
				       MKDEV(0, 0), NULL,
				       "%s", ib_device->name);
				       "%s", dev_name(&ib_device->dev));
	if (IS_ERR(cm_dev->device)) {
		kfree(cm_dev);
		return;
+1 −1
Original line number Diff line number Diff line
@@ -65,7 +65,7 @@ static struct cma_dev_port_group *to_dev_port_group(struct config_item *item)

static bool filter_by_name(struct ib_device *ib_dev, void *cookie)
{
	return !strcmp(ib_dev->name, cookie);
	return !strcmp(dev_name(&ib_dev->dev), cookie);
}

static int cma_configfs_params_get(struct config_item *item,
+3 −5
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ static struct ib_device *__ib_device_get_by_name(const char *name)
	struct ib_device *device;

	list_for_each_entry(device, &device_list, core_list)
		if (!strncmp(name, device->name, IB_DEVICE_NAME_MAX))
		if (!strcmp(name, dev_name(&device->dev)))
			return device;

	return NULL;
@@ -184,7 +184,7 @@ static int alloc_name(struct ib_device *ibdev, const char *name)
	list_for_each_entry(device, &device_list, core_list) {
		char buf[IB_DEVICE_NAME_MAX];

		if (sscanf(device->name, name, &i) != 1)
		if (sscanf(dev_name(&device->dev), name, &i) != 1)
			continue;
		if (i < 0 || i >= PAGE_SIZE * 8)
			continue;
@@ -219,9 +219,7 @@ static void ib_device_release(struct device *device)
static int ib_device_uevent(struct device *device,
			    struct kobj_uevent_env *env)
{
	struct ib_device *dev = container_of(device, struct ib_device, dev);

	if (add_uevent_var(env, "NAME=%s", dev->name))
	if (add_uevent_var(env, "NAME=%s", dev_name(device)))
		return -ENOMEM;

	/*
+2 −1
Original line number Diff line number Diff line
@@ -257,7 +257,8 @@ struct ib_fmr_pool *ib_create_fmr_pool(struct ib_pd *pd,
	atomic_set(&pool->flush_ser, 0);
	init_waitqueue_head(&pool->force_wait);

	pool->worker = kthread_create_worker(0, "ib_fmr(%s)", device->name);
	pool->worker =
		kthread_create_worker(0, "ib_fmr(%s)", dev_name(&device->dev));
	if (IS_ERR(pool->worker)) {
		pr_warn(PFX "couldn't start cleanup kthread worker\n");
		ret = PTR_ERR(pool->worker);
+1 −1
Original line number Diff line number Diff line
@@ -509,7 +509,7 @@ static int iw_cm_map(struct iw_cm_id *cm_id, bool active)
	cm_id->m_local_addr = cm_id->local_addr;
	cm_id->m_remote_addr = cm_id->remote_addr;

	memcpy(pm_reg_msg.dev_name, cm_id->device->name,
	memcpy(pm_reg_msg.dev_name, dev_name(&cm_id->device->dev),
	       sizeof(pm_reg_msg.dev_name));
	memcpy(pm_reg_msg.if_name, cm_id->device->iwcm->ifname,
	       sizeof(pm_reg_msg.if_name));
Loading