aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rdma/hfi1/diag.c
diff options
context:
space:
mode:
authorIra Weiny <ira.weiny@intel.com>2015-09-17 13:47:49 -0400
committerDoug Ledford <dledford@redhat.com>2015-09-18 11:28:47 -0400
commite116a64fab650aed3d7b9b4db0b59c07f361bc9f (patch)
tree87443bf22b75104c7a707e538c3ec4f5565d1a6f /drivers/staging/rdma/hfi1/diag.c
parentIB/hfi1: mask vs shift confusion (diff)
downloadlinux-dev-e116a64fab650aed3d7b9b4db0b59c07f361bc9f.tar.xz
linux-dev-e116a64fab650aed3d7b9b4db0b59c07f361bc9f.zip
IB/hfi: Properly set permissions for user device files
Some of the device files are required to be user accessible for PSM while most should remain accessible only by root. Add a parameter to hfi1_cdev_init which controls if the user should have access to this device which places it in a different class with the appropriate devnode callback. In addition set the devnode call back for the existing class to be a bit more explicit for those permissions. Finally remove the unnecessary null check before class_destroy Tested-by: Donald Dutile <ddutile@redhat.com> Signed-off-by: Haralanov, Mitko (mitko.haralanov@intel.com) Signed-off-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/staging/rdma/hfi1/diag.c')
-rw-r--r--drivers/staging/rdma/hfi1/diag.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/staging/rdma/hfi1/diag.c b/drivers/staging/rdma/hfi1/diag.c
index ce01deea834c..3e8d5ac4c626 100644
--- a/drivers/staging/rdma/hfi1/diag.c
+++ b/drivers/staging/rdma/hfi1/diag.c
@@ -292,7 +292,7 @@ int hfi1_diag_add(struct hfi1_devdata *dd)
if (atomic_inc_return(&diagpkt_count) == 1) {
ret = hfi1_cdev_init(HFI1_DIAGPKT_MINOR, name,
&diagpkt_file_ops, &diagpkt_cdev,
- &diagpkt_device);
+ &diagpkt_device, false);
}
return ret;
@@ -592,7 +592,8 @@ static int hfi1_snoop_add(struct hfi1_devdata *dd, const char *name)
ret = hfi1_cdev_init(HFI1_SNOOP_CAPTURE_BASE + dd->unit, name,
&snoop_file_ops,
- &dd->hfi1_snoop.cdev, &dd->hfi1_snoop.class_dev);
+ &dd->hfi1_snoop.cdev, &dd->hfi1_snoop.class_dev,
+ false);
if (ret) {
dd_dev_err(dd, "Couldn't create %s device: %d", name, ret);