aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/device.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-09-20 16:42:23 -0600
committerJason Gunthorpe <jgg@mellanox.com>2018-09-26 13:51:48 -0600
commit43c7c851b9bce9e6091f2c882871a3b388aa38c3 (patch)
tree5b9196b160b6373dfef148506a153130786f88e8 /drivers/infiniband/core/device.c
parentRDMA: Fully setup the device name in ib_register_device (diff)
downloadlinux-dev-43c7c851b9bce9e6091f2c882871a3b388aa38c3.tar.xz
linux-dev-43c7c851b9bce9e6091f2c882871a3b388aa38c3.zip
RDMA/core: Use dev_err/dbg/etc instead of pr_* + ibdev->name
Any messages related to a device should be printed with the dev_* formatters. This provides greater consistency for the user. The core does not set pr_fmt so this has no significant change. 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.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index faacf95699d7..7c3ff43092fd 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -123,8 +123,9 @@ static int ib_device_check_mandatory(struct ib_device *device)
for (i = 0; i < ARRAY_SIZE(mandatory_table); ++i) {
if (!*(void **) ((void *) device + mandatory_table[i].offset)) {
- pr_warn("Device %s is missing mandatory function %s\n",
- device->name, mandatory_table[i].name);
+ dev_warn(&device->dev,
+ "Device is missing mandatory function %s\n",
+ mandatory_table[i].name);
return -EINVAL;
}
}
@@ -513,20 +514,21 @@ int ib_register_device(struct ib_device *device, const char *name,
ret = read_port_immutable(device);
if (ret) {
- pr_warn("Couldn't create per port immutable data %s\n",
- device->name);
+ dev_warn(&device->dev,
+ "Couldn't create per port immutable data\n");
goto out;
}
ret = setup_port_pkey_list(device);
if (ret) {
- pr_warn("Couldn't create per port_pkey_list\n");
+ dev_warn(&device->dev, "Couldn't create per port_pkey_list\n");
goto out;
}
ret = ib_cache_setup_one(device);
if (ret) {
- pr_warn("Couldn't set up InfiniBand P_Key/GID cache\n");
+ dev_warn(&device->dev,
+ "Couldn't set up InfiniBand P_Key/GID cache\n");
goto port_cleanup;
}
@@ -534,21 +536,23 @@ int ib_register_device(struct ib_device *device, const char *name,
ret = ib_device_register_rdmacg(device);
if (ret) {
- pr_warn("Couldn't register device with rdma cgroup\n");
+ dev_warn(&device->dev,
+ "Couldn't register device with rdma cgroup\n");
goto cache_cleanup;
}
memset(&device->attrs, 0, sizeof(device->attrs));
ret = device->query_device(device, &device->attrs, &uhw);
if (ret) {
- pr_warn("Couldn't query the device attributes\n");
+ dev_warn(&device->dev,
+ "Couldn't query the device attributes\n");
goto cg_cleanup;
}
ret = ib_device_register_sysfs(device, port_callback);
if (ret) {
- pr_warn("Couldn't register device %s with driver model\n",
- device->name);
+ dev_warn(&device->dev,
+ "Couldn't register device with driver model\n");
goto cg_cleanup;
}
@@ -699,8 +703,9 @@ void ib_unregister_client(struct ib_client *client)
found_context->data : NULL);
if (!found_context) {
- pr_warn("No client context found for %s/%s\n",
- device->name, client->name);
+ dev_warn(&device->dev,
+ "No client context found for %s\n",
+ client->name);
continue;
}
@@ -764,8 +769,8 @@ void ib_set_client_data(struct ib_device *device, struct ib_client *client,
goto out;
}
- pr_warn("No client context found for %s/%s\n",
- device->name, client->name);
+ dev_warn(&device->dev, "No client context found for %s\n",
+ client->name);
out:
write_unlock_irqrestore(&device->client_data_lock, flags);