summaryrefslogtreecommitdiffstats
path: root/drivers/char/tty_io.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-21 00:55:39 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-21 00:55:39 +0200
commita57c21c7159e07c27e317ea3513dfb382be3f153 (patch)
treed70427d2d2f44b9d973aa21e7eef93f30f17515d /drivers/char/tty_io.c
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6 (diff)
parentDriver-Core: extend devnode callbacks to provide permissions (diff)
downloadlinux-a57c21c7159e07c27e317ea3513dfb382be3f153.tar.xz
linux-a57c21c7159e07c27e317ea3513dfb382be3f153.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: Driver-Core: extend devnode callbacks to provide permissions
Diffstat (limited to 'drivers/char/tty_io.c')
-rw-r--r--drivers/char/tty_io.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 05f443c47bbe..ea18a129b0b5 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -3070,11 +3070,22 @@ void __init console_init(void)
}
}
+static char *tty_devnode(struct device *dev, mode_t *mode)
+{
+ if (!mode)
+ return NULL;
+ if (dev->devt == MKDEV(TTYAUX_MAJOR, 0) ||
+ dev->devt == MKDEV(TTYAUX_MAJOR, 2))
+ *mode = 0666;
+ return NULL;
+}
+
static int __init tty_class_init(void)
{
tty_class = class_create(THIS_MODULE, "tty");
if (IS_ERR(tty_class))
return PTR_ERR(tty_class);
+ tty_class->devnode = tty_devnode;
return 0;
}