aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/core/uverbs_main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index ec83e9fe387b..e49a85f8a44d 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -824,6 +824,12 @@ static void ib_uverbs_remove_one(struct ib_device *device)
824 kfree(uverbs_dev); 824 kfree(uverbs_dev);
825} 825}
826 826
827static char *uverbs_devnode(struct device *dev, mode_t *mode)
828{
829 *mode = 0666;
830 return kasprintf(GFP_KERNEL, "infiniband/%s", dev_name(dev));
831}
832
827static int __init ib_uverbs_init(void) 833static int __init ib_uverbs_init(void)
828{ 834{
829 int ret; 835 int ret;
@@ -842,6 +848,8 @@ static int __init ib_uverbs_init(void)
842 goto out_chrdev; 848 goto out_chrdev;
843 } 849 }
844 850
851 uverbs_class->devnode = uverbs_devnode;
852
845 ret = class_create_file(uverbs_class, &class_attr_abi_version.attr); 853 ret = class_create_file(uverbs_class, &class_attr_abi_version.attr);
846 if (ret) { 854 if (ret) {
847 printk(KERN_ERR "user_verbs: couldn't create abi_version attribute\n"); 855 printk(KERN_ERR "user_verbs: couldn't create abi_version attribute\n");