diff options
author | Roland Dreier <roland@purestorage.com> | 2011-05-23 20:10:05 +0200 |
---|---|---|
committer | Roland Dreier <roland@purestorage.com> | 2011-05-23 20:10:05 +0200 |
commit | 71c29bd5c23559c9cabcca3bfb3152ecc5efcd75 (patch) | |
tree | d4c1e56584e664b0bad103370955a6883f247cf3 /drivers/infiniband | |
parent | selinux: avoid unnecessary avc cache stat hit count (diff) | |
download | linux-71c29bd5c23559c9cabcca3bfb3152ecc5efcd75.tar.xz linux-71c29bd5c23559c9cabcca3bfb3152ecc5efcd75.zip |
IB/uverbs: Add devnode method to set path/mode
We want udev to create a device node under /dev/infiniband with
permission 0666 for uverbsX devices, so add a devnode method to set the
appropriate info.
Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/core/uverbs_main.c | 8 |
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) kfree(uverbs_dev); } +static char *uverbs_devnode(struct device *dev, mode_t *mode) +{ + *mode = 0666; + return kasprintf(GFP_KERNEL, "infiniband/%s", dev_name(dev)); +} + static int __init ib_uverbs_init(void) { int ret; @@ -842,6 +848,8 @@ static int __init ib_uverbs_init(void) goto out_chrdev; } + uverbs_class->devnode = uverbs_devnode; + ret = class_create_file(uverbs_class, &class_attr_abi_version.attr); if (ret) { printk(KERN_ERR "user_verbs: couldn't create abi_version attribute\n"); |