summaryrefslogtreecommitdiff
path: root/drivers/infiniband/core/cm.c
diff options
context:
space:
mode:
authorRoland Dreier <roland@purestorage.com>2011-05-23 11:21:47 -0700
committerRoland Dreier <roland@purestorage.com>2011-05-23 11:24:28 -0700
commitc3af0980ce01dfb8e946990c3ae4c3727b1e9f26 (patch)
tree13552e10c7b36da435d4aa950a9a569e561f3dff /drivers/infiniband/core/cm.c
parentc8367c4cd9de512d296fc557f121be62a43987f3 (diff)
downloadlwn-c3af0980ce01dfb8e946990c3ae4c3727b1e9f26.tar.gz
lwn-c3af0980ce01dfb8e946990c3ae4c3727b1e9f26.zip
IB: Add devnode methods to cm_class and umad_class
We want the ucmX, umadX and issmX device nodes to show up under /dev/infiniband, and additionally ucmX should have mode 0666. Add appropriate devnode methods to their class structs for this. Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/core/cm.c')
-rw-r--r--drivers/infiniband/core/cm.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index f804e28e1ebb..f62f52fb9ece 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -3639,8 +3639,16 @@ static struct kobj_type cm_port_obj_type = {
.release = cm_release_port_obj
};
+static char *cm_devnode(struct device *dev, mode_t *mode)
+{
+ *mode = 0666;
+ return kasprintf(GFP_KERNEL, "infiniband/%s", dev_name(dev));
+}
+
struct class cm_class = {
+ .owner = THIS_MODULE,
.name = "infiniband_cm",
+ .devnode = cm_devnode,
};
EXPORT_SYMBOL(cm_class);