diff options
author | Ira Weiny | 2015-09-17 19:47:49 +0200 |
---|---|---|
committer | Doug Ledford | 2015-09-18 17:28:47 +0200 |
commit | e116a64fab650aed3d7b9b4db0b59c07f361bc9f (patch) | |
tree | 87443bf22b75104c7a707e538c3ec4f5565d1a6f /drivers/staging/rdma/hfi1/device.h | |
parent | IB/hfi1: mask vs shift confusion (diff) | |
download | kernel-qcow2-linux-e116a64fab650aed3d7b9b4db0b59c07f361bc9f.tar.gz kernel-qcow2-linux-e116a64fab650aed3d7b9b4db0b59c07f361bc9f.tar.xz kernel-qcow2-linux-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/device.h')
-rw-r--r-- | drivers/staging/rdma/hfi1/device.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/rdma/hfi1/device.h b/drivers/staging/rdma/hfi1/device.h index 98caecd3d807..2850ff739d81 100644 --- a/drivers/staging/rdma/hfi1/device.h +++ b/drivers/staging/rdma/hfi1/device.h @@ -52,7 +52,8 @@ int hfi1_cdev_init(int minor, const char *name, const struct file_operations *fops, - struct cdev *cdev, struct device **devp); + struct cdev *cdev, struct device **devp, + bool user_accessible); void hfi1_cdev_cleanup(struct cdev *cdev, struct device **devp); const char *class_name(void); int __init dev_init(void); |