Commit 5372b1d1 authored by Federico Vaga's avatar Federico Vaga

sw:drv: bugfix to make TTY working on CC7

The interface, somehow, changed and a link between driver and port must
be created in order for it to work on v3.10 (our CentOs 7)
Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent d1bc10f6
......@@ -183,10 +183,16 @@ static int trtl_tty_port_init(struct trtl_cpu *cpu)
return -1;
tty_port_init(&cpu->tty_port);
cpu->tty_port.ops = &null_ops;
#if KERNEL_VERSION(3, 7, 0) <= LINUX_VERSION_CODE
cpu->tty_dev = tty_port_register_device(&cpu->tty_port,
trtl->tty_driver,
cpu->tty_index,
&cpu->dev);
#else
cpu->tty_dev = tty_register_device(trtl->tty_driver,
cpu->tty_index,
&cpu->dev);
#endif
if (IS_ERR_OR_NULL(cpu->tty_dev)) {
tty_port_put(&cpu->tty_port);
return PTR_ERR(cpu->tty_dev);
......@@ -201,6 +207,9 @@ static void trtl_tty_port_exit(struct trtl_cpu *cpu)
struct trtl_dev *trtl = to_trtl_dev(cpu->dev.parent);
tty_unregister_device(trtl->tty_driver, cpu->tty_index);
#if KERNEL_VERSION(3, 7, 0) <= LINUX_VERSION_CODE
tty_port_destroy(&cpu->tty_port);
#endif
trtl_tty_put_minor(cpu->tty_index);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment