Skip to content

Commit

Permalink
GenWQE: Change default access rights for device node
Browse files Browse the repository at this point in the history
Since it should always be ok for normal users to operate the accelerator,
it makes sense to change it in our driver, rather than adding udev rules
for all Linux distributions.

Signed-off-by: Frank Haverkamp <haver@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Frank Haverkamp authored and Greg Kroah-Hartman committed Aug 31, 2016
1 parent d6a38c0 commit 5ed22ce
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions drivers/misc/genwqe/card_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,19 @@ static struct pci_driver genwqe_driver = {
.err_handler = &genwqe_err_handler,
};

/**
* genwqe_devnode() - Set default access mode for genwqe devices.
*
* Default mode should be rw for everybody. Do not change default
* device name.
*/
static char *genwqe_devnode(struct device *dev, umode_t *mode)
{
if (mode)
*mode = 0666;
return NULL;
}

/**
* genwqe_init_module() - Driver registration and initialization
*/
Expand All @@ -1363,6 +1376,8 @@ static int __init genwqe_init_module(void)
return -ENOMEM;
}

class_genwqe->devnode = genwqe_devnode;

debugfs_genwqe = debugfs_create_dir(GENWQE_DEVNAME, NULL);
if (!debugfs_genwqe) {
rc = -ENOMEM;
Expand Down

0 comments on commit 5ed22ce

Please sign in to comment.