cdev: do not hardcode TTY major
authorDavid Herrmann <dh.herrmann@googlemail.com>
Thu, 6 Dec 2012 13:45:52 +0000 (14:45 +0100)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Thu, 6 Dec 2012 13:45:52 +0000 (14:45 +0100)
Use TTY_MAJOR instead of hardcoding the literal 4.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/kmscon_cdev.c

index 60be7a1..e80f676 100644 (file)
@@ -32,6 +32,7 @@
 #include <errno.h>
 #include <fcntl.h>
 #include <linux/kd.h>
+#include <linux/major.h>
 #include <linux/vt.h>
 #include <pthread.h>
 #include <signal.h>
@@ -1295,7 +1296,7 @@ static int kmscon_cdev_init(struct kmscon_cdev *cdev)
 
        dev_info_argv[0] = name;
        memset(&ci, 0, sizeof(ci));
-       ci.dev_major = 4;
+       ci.dev_major = TTY_MAJOR;
        ci.dev_minor = cdev->minor;
        ci.dev_info_argc = 1;
        ci.dev_info_argv = dev_info_argv;