Commit 65caa3d86cc9539d98054b64a62865be7b1769fd

Authored by Marco Aurelio da Costa
1 parent 5789f5ad

Use dynamic MAJOR number

Showing 1 changed file with 2 additions and 4 deletions
module/tty0tty.c
@@ -55,9 +55,6 @@ short pairs = 4; //Default number of pairs of devices @@ -55,9 +55,6 @@ short pairs = 4; //Default number of pairs of devices
55 module_param(pairs, short, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); 55 module_param(pairs, short, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
56 MODULE_PARM_DESC(pairs, "Number of pairs of devices to be created, maximum of 128"); 56 MODULE_PARM_DESC(pairs, "Number of pairs of devices to be created, maximum of 128");
57 57
58 -  
59 -#define TTY0TTY_MAJOR 240 /* experimental range */  
60 -  
61 /* fake UART values */ 58 /* fake UART values */
62 //out 59 //out
63 #define MCR_DTR 0x01 60 #define MCR_DTR 0x01
@@ -648,7 +645,8 @@ static int __init tty0tty_init(void) @@ -648,7 +645,8 @@ static int __init tty0tty_init(void)
648 tty0tty_tty_driver->driver_name = "tty0tty"; 645 tty0tty_tty_driver->driver_name = "tty0tty";
649 tty0tty_tty_driver->name = "tnt"; 646 tty0tty_tty_driver->name = "tnt";
650 /* no more devfs subsystem */ 647 /* no more devfs subsystem */
651 - tty0tty_tty_driver->major = TTY0TTY_MAJOR; 648 + /* get dynamic major number */
  649 + tty0tty_tty_driver->major = 0;
652 tty0tty_tty_driver->type = TTY_DRIVER_TYPE_SERIAL; 650 tty0tty_tty_driver->type = TTY_DRIVER_TYPE_SERIAL;
653 tty0tty_tty_driver->subtype = SERIAL_TYPE_NORMAL; 651 tty0tty_tty_driver->subtype = SERIAL_TYPE_NORMAL;
654 tty0tty_tty_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW ; 652 tty0tty_tty_driver->flags = TTY_DRIVER_RESET_TERMIOS | TTY_DRIVER_REAL_RAW ;