Skip to content

Commit 9dcdf9a

Browse files
MingcongBaiKexyBiscuit
authored andcommitted
AOSCOS: staging: sb105x: replace alloc_tty_driver() with tty_alloc_driver()
Per commit 39b7b42 ("tty: stop using alloc_tty_driver"), all instances of `alloc_tty_driver()' were revised into `tty_alloc_driver()' with an extra `flags' argument (merged from the `flags' member of `struct tty_driver'. The `tty_alloc_driver()' function was then removed in commit 56ec588 ("tty: drop alloc_tty_driver"). Follow this chain of changes and revise the driver code. Fixes: "AOSCOS: Revert "staging: sb105x: delete the driver"" Signed-off-by: Mingcong Bai <[email protected]> Signed-off-by: Kexy Biscuit <[email protected]>
1 parent ef17826 commit 9dcdf9a

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

drivers/staging/sb105x/sb_pci_mp.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,12 +1728,10 @@ static int mp_register_driver(struct uart_driver *drv)
17281728
}
17291729
memset(drv->state, 0, sizeof(struct sb_uart_state) * drv->nr);
17301730

1731-
normal = alloc_tty_driver(drv->nr);
1732-
if (!normal)
1733-
{
1734-
printk("SB PCI Error: tty allocation error!\n");
1735-
goto out;
1736-
}
1731+
normal = tty_alloc_driver(drv->nr,
1732+
TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV);
1733+
if (IS_ERR(normal))
1734+
return PTR_ERR(normal);
17371735

17381736
drv->tty_driver = normal;
17391737

@@ -1750,7 +1748,6 @@ static int mp_register_driver(struct uart_driver *drv)
17501748
normal->subtype = SERIAL_TYPE_NORMAL;
17511749
normal->init_termios = tty_std_termios;
17521750
normal->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
1753-
normal->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
17541751
normal->driver_state = drv;
17551752

17561753
tty_set_operations(normal, &sb_mp_ops);

0 commit comments

Comments
 (0)