aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorIra Weiny <ira.weiny@intel.com>2014-08-08 19:00:52 -0400
committerRoland Dreier <roland@purestorage.com>2014-08-10 22:50:07 -0400
commitf426a40eb695d315466f130618db30cafb27db90 (patch)
tree57bcbee1da1d6dce9ccef50fe75169537c5f8029 /drivers/infiniband
parent64aa90f26c06e1cb2aacfb98a7d0eccfbd6c1a91 (diff)
IB/umad: Update module to [pr|dev]_* style print messages
Use dev_* style print when struct device is available. Also combine previously line broken user-visible strings as per Documentation/CodingStyle: "However, never break user-visible strings such as printk messages, because that breaks the ability to grep for them." Signed-off-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/user_mad.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
index 1acb99100556..6be596dc360a 100644
--- a/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -33,6 +33,8 @@
33 * SOFTWARE. 33 * SOFTWARE.
34 */ 34 */
35 35
36#define pr_fmt(fmt) "user_mad: " fmt
37
36#include <linux/module.h> 38#include <linux/module.h>
37#include <linux/init.h> 39#include <linux/init.h>
38#include <linux/device.h> 40#include <linux/device.h>
@@ -673,10 +675,11 @@ found:
673 if (!file->already_used) { 675 if (!file->already_used) {
674 file->already_used = 1; 676 file->already_used = 1;
675 if (!file->use_pkey_index) { 677 if (!file->use_pkey_index) {
676 printk(KERN_WARNING "user_mad: process %s did not enable " 678 dev_warn(file->port->dev,
677 "P_Key index support.\n", current->comm); 679 "process %s did not enable P_Key index support.\n",
678 printk(KERN_WARNING "user_mad: Documentation/infiniband/user_mad.txt " 680 current->comm);
679 "has info on the new ABI.\n"); 681 dev_warn(file->port->dev,
682 " Documentation/infiniband/user_mad.txt has info on the new ABI.\n");
680 } 683 }
681 } 684 }
682 685
@@ -983,7 +986,7 @@ static CLASS_ATTR_STRING(abi_version, S_IRUGO,
983 986
984static dev_t overflow_maj; 987static dev_t overflow_maj;
985static DECLARE_BITMAP(overflow_map, IB_UMAD_MAX_PORTS); 988static DECLARE_BITMAP(overflow_map, IB_UMAD_MAX_PORTS);
986static int find_overflow_devnum(void) 989static int find_overflow_devnum(struct ib_device *device)
987{ 990{
988 int ret; 991 int ret;
989 992
@@ -991,7 +994,8 @@ static int find_overflow_devnum(void)
991 ret = alloc_chrdev_region(&overflow_maj, 0, IB_UMAD_MAX_PORTS * 2, 994 ret = alloc_chrdev_region(&overflow_maj, 0, IB_UMAD_MAX_PORTS * 2,
992 "infiniband_mad"); 995 "infiniband_mad");
993 if (ret) { 996 if (ret) {
994 printk(KERN_ERR "user_mad: couldn't register dynamic device number\n"); 997 dev_err(&device->dev,
998 "couldn't register dynamic device number\n");
995 return ret; 999 return ret;
996 } 1000 }
997 } 1001 }
@@ -1014,7 +1018,7 @@ static int ib_umad_init_port(struct ib_device *device, int port_num,
1014 devnum = find_first_zero_bit(dev_map, IB_UMAD_MAX_PORTS); 1018 devnum = find_first_zero_bit(dev_map, IB_UMAD_MAX_PORTS);
1015 if (devnum >= IB_UMAD_MAX_PORTS) { 1019 if (devnum >= IB_UMAD_MAX_PORTS) {
1016 spin_unlock(&port_lock); 1020 spin_unlock(&port_lock);
1017 devnum = find_overflow_devnum(); 1021 devnum = find_overflow_devnum(device);
1018 if (devnum < 0) 1022 if (devnum < 0)
1019 return -1; 1023 return -1;
1020 1024
@@ -1200,14 +1204,14 @@ static int __init ib_umad_init(void)
1200 ret = register_chrdev_region(base_dev, IB_UMAD_MAX_PORTS * 2, 1204 ret = register_chrdev_region(base_dev, IB_UMAD_MAX_PORTS * 2,
1201 "infiniband_mad"); 1205 "infiniband_mad");
1202 if (ret) { 1206 if (ret) {
1203 printk(KERN_ERR "user_mad: couldn't register device number\n"); 1207 pr_err("couldn't register device number\n");
1204 goto out; 1208 goto out;
1205 } 1209 }
1206 1210
1207 umad_class = class_create(THIS_MODULE, "infiniband_mad"); 1211 umad_class = class_create(THIS_MODULE, "infiniband_mad");
1208 if (IS_ERR(umad_class)) { 1212 if (IS_ERR(umad_class)) {
1209 ret = PTR_ERR(umad_class); 1213 ret = PTR_ERR(umad_class);
1210 printk(KERN_ERR "user_mad: couldn't create class infiniband_mad\n"); 1214 pr_err("couldn't create class infiniband_mad\n");
1211 goto out_chrdev; 1215 goto out_chrdev;
1212 } 1216 }
1213 1217
@@ -1215,13 +1219,13 @@ static int __init ib_umad_init(void)
1215 1219
1216 ret = class_create_file(umad_class, &class_attr_abi_version.attr); 1220 ret = class_create_file(umad_class, &class_attr_abi_version.attr);
1217 if (ret) { 1221 if (ret) {
1218 printk(KERN_ERR "user_mad: couldn't create abi_version attribute\n"); 1222 pr_err("couldn't create abi_version attribute\n");
1219 goto out_class; 1223 goto out_class;
1220 } 1224 }
1221 1225
1222 ret = ib_register_client(&umad_client); 1226 ret = ib_register_client(&umad_client);
1223 if (ret) { 1227 if (ret) {
1224 printk(KERN_ERR "user_mad: couldn't register ib_umad client\n"); 1228 pr_err("couldn't register ib_umad client\n");
1225 goto out_class; 1229 goto out_class;
1226 } 1230 }
1227 1231