aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/tty_io.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-20 18:55:39 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-20 18:55:39 -0400
commita57c21c7159e07c27e317ea3513dfb382be3f153 (patch)
treed70427d2d2f44b9d973aa21e7eef93f30f17515d /drivers/char/tty_io.c
parente11c675ede0d42a405ae595528bf0b29ce1ae56f (diff)
parente454cea20bdcff10ee698d11b8882662a0153a47 (diff)
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)
3070 } 3070 }
3071} 3071}
3072 3072
3073static char *tty_devnode(struct device *dev, mode_t *mode)
3074{
3075 if (!mode)
3076 return NULL;
3077 if (dev->devt == MKDEV(TTYAUX_MAJOR, 0) ||
3078 dev->devt == MKDEV(TTYAUX_MAJOR, 2))
3079 *mode = 0666;
3080 return NULL;
3081}
3082
3073static int __init tty_class_init(void) 3083static int __init tty_class_init(void)
3074{ 3084{
3075 tty_class = class_create(THIS_MODULE, "tty"); 3085 tty_class = class_create(THIS_MODULE, "tty");
3076 if (IS_ERR(tty_class)) 3086 if (IS_ERR(tty_class))
3077 return PTR_ERR(tty_class); 3087 return PTR_ERR(tty_class);
3088 tty_class->devnode = tty_devnode;
3078 return 0; 3089 return 0;
3079} 3090}
3080 3091