IB/mlx5: Fix decision on using MAD_IFC
[deliverable/linux.git] / drivers / infiniband / core / device.c
index 00da80e02154205c428ca00702f4b7c10fa5a829..270c7ff6cba7870d86a7c5d81eeced269011e2df 100644 (file)
@@ -115,8 +115,8 @@ 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)) {
-                       printk(KERN_WARNING "Device %s is missing mandatory function %s\n",
-                              device->name, mandatory_table[i].name);
+                       pr_warn("Device %s is missing mandatory function %s\n",
+                               device->name, mandatory_table[i].name);
                        return -EINVAL;
                }
        }
@@ -255,8 +255,8 @@ static int add_client_context(struct ib_device *device, struct ib_client *client
 
        context = kmalloc(sizeof *context, GFP_KERNEL);
        if (!context) {
-               printk(KERN_WARNING "Couldn't allocate client context for %s/%s\n",
-                      device->name, client->name);
+               pr_warn("Couldn't allocate client context for %s/%s\n",
+                       device->name, client->name);
                return -ENOMEM;
        }
 
@@ -343,28 +343,29 @@ int ib_register_device(struct ib_device *device,
 
        ret = read_port_immutable(device);
        if (ret) {
-               printk(KERN_WARNING "Couldn't create per port immutable data %s\n",
-                      device->name);
+               pr_warn("Couldn't create per port immutable data %s\n",
+                       device->name);
                goto out;
        }
 
        ret = ib_cache_setup_one(device);
        if (ret) {
-               printk(KERN_WARNING "Couldn't set up InfiniBand P_Key/GID cache\n");
+               pr_warn("Couldn't set up InfiniBand P_Key/GID cache\n");
                goto out;
        }
 
        memset(&device->attrs, 0, sizeof(device->attrs));
        ret = device->query_device(device, &device->attrs, &uhw);
        if (ret) {
-               printk(KERN_WARNING "Couldn't query the device attributes\n");
+               pr_warn("Couldn't query the device attributes\n");
+               ib_cache_cleanup_one(device);
                goto out;
        }
 
        ret = ib_device_register_sysfs(device, port_callback);
        if (ret) {
-               printk(KERN_WARNING "Couldn't register device %s with driver model\n",
-                      device->name);
+               pr_warn("Couldn't register device %s with driver model\n",
+                       device->name);
                ib_cache_cleanup_one(device);
                goto out;
        }
@@ -565,8 +566,8 @@ void ib_set_client_data(struct ib_device *device, struct ib_client *client,
                        goto out;
                }
 
-       printk(KERN_WARNING "No client context found for %s/%s\n",
-              device->name, client->name);
+       pr_warn("No client context found for %s/%s\n",
+               device->name, client->name);
 
 out:
        spin_unlock_irqrestore(&device->client_data_lock, flags);
@@ -959,13 +960,13 @@ static int __init ib_core_init(void)
 
        ret = class_register(&ib_class);
        if (ret) {
-               printk(KERN_WARNING "Couldn't create InfiniBand device class\n");
+               pr_warn("Couldn't create InfiniBand device class\n");
                goto err_comp;
        }
 
        ret = ibnl_init();
        if (ret) {
-               printk(KERN_WARNING "Couldn't init IB netlink interface\n");
+               pr_warn("Couldn't init IB netlink interface\n");
                goto err_sysfs;
        }
 
This page took 0.028005 seconds and 5 git commands to generate.