aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/device.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-09-20 16:42:25 -0600
committerJason Gunthorpe <jgg@mellanox.com>2018-09-26 13:51:48 -0600
commit896de0090a85f4c3a2b37fc0f46215a73c5b5429 (patch)
tree7534ebddc4049159e762e5f454a56ba585f6b186 /drivers/infiniband/core/device.c
parentRDMA/drivers: Use dev_err/dbg/etc instead of pr_* + ibdev->name (diff)
downloadlinux-dev-896de0090a85f4c3a2b37fc0f46215a73c5b5429.tar.xz
linux-dev-896de0090a85f4c3a2b37fc0f46215a73c5b5429.zip
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: Jason Gunthorpe <jgg@mellanox.com> Reviewed-by: Steve Wise <swise@opengridcomputing.com> Reviewed-by: Leon Romanovsky <leonro@mellanox.com> Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Diffstat (limited to 'drivers/infiniband/core/device.c')
-rw-r--r--drivers/infiniband/core/device.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index 7c3ff43092fd..d105b9b2d118 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -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;
/*