aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/core/ucm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/core/ucm.c')
-rw-r--r--drivers/infiniband/core/ucm.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c
index 02e209ff33fd..017d6e24448f 100644
--- a/drivers/infiniband/core/ucm.c
+++ b/drivers/infiniband/core/ucm.c
@@ -1336,13 +1336,8 @@ static void ib_ucm_remove_one(struct ib_device *device)
1336 device_unregister(&ucm_dev->dev); 1336 device_unregister(&ucm_dev->dev);
1337} 1337}
1338 1338
1339static ssize_t show_abi_version(struct class *class, 1339static CLASS_ATTR_STRING(abi_version, S_IRUGO,
1340 struct class_attribute *attr, 1340 __stringify(IB_USER_CM_ABI_VERSION));
1341 char *buf)
1342{
1343 return sprintf(buf, "%d\n", IB_USER_CM_ABI_VERSION);
1344}
1345static CLASS_ATTR(abi_version, S_IRUGO, show_abi_version, NULL);
1346 1341
1347static int __init ib_ucm_init(void) 1342static int __init ib_ucm_init(void)
1348{ 1343{
@@ -1355,7 +1350,7 @@ static int __init ib_ucm_init(void)
1355 goto error1; 1350 goto error1;
1356 } 1351 }
1357 1352
1358 ret = class_create_file(&cm_class, &class_attr_abi_version); 1353 ret = class_create_file(&cm_class, &class_attr_abi_version.attr);
1359 if (ret) { 1354 if (ret) {
1360 printk(KERN_ERR "ucm: couldn't create abi_version attribute\n"); 1355 printk(KERN_ERR "ucm: couldn't create abi_version attribute\n");
1361 goto error2; 1356 goto error2;
@@ -1369,7 +1364,7 @@ static int __init ib_ucm_init(void)
1369 return 0; 1364 return 0;
1370 1365
1371error3: 1366error3:
1372 class_remove_file(&cm_class, &class_attr_abi_version); 1367 class_remove_file(&cm_class, &class_attr_abi_version.attr);
1373error2: 1368error2:
1374 unregister_chrdev_region(IB_UCM_BASE_DEV, IB_UCM_MAX_DEVICES); 1369 unregister_chrdev_region(IB_UCM_BASE_DEV, IB_UCM_MAX_DEVICES);
1375error1: 1370error1:
@@ -1379,7 +1374,7 @@ error1:
1379static void __exit ib_ucm_cleanup(void) 1374static void __exit ib_ucm_cleanup(void)
1380{ 1375{
1381 ib_unregister_client(&ucm_client); 1376 ib_unregister_client(&ucm_client);
1382 class_remove_file(&cm_class, &class_attr_abi_version); 1377 class_remove_file(&cm_class, &class_attr_abi_version.attr);
1383 unregister_chrdev_region(IB_UCM_BASE_DEV, IB_UCM_MAX_DEVICES); 1378 unregister_chrdev_region(IB_UCM_BASE_DEV, IB_UCM_MAX_DEVICES);
1384 if (overflow_maj) 1379 if (overflow_maj)
1385 unregister_chrdev_region(overflow_maj, IB_UCM_MAX_DEVICES); 1380 unregister_chrdev_region(overflow_maj, IB_UCM_MAX_DEVICES);