From 21aca2fa00259f781d228496631b61dbb4274e90 Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Wed, 8 Aug 2012 22:26:41 +0200 Subject: TTY: pty, switch to tty_alloc_driver Switch to the new driver allocation interface, as this is one of the special call-sites. Here, we need TTY_DRIVER_DYNAMIC_ALLOC to not allocate tty_driver->ports, cdevs and potentially other structures because we reserve too many lines in pty. Instead, it provides the tty_port<->tty_struct link in tty->ops->install already. Signed-off-by: Jiri Slaby Acked-by: Alan Cox Signed-off-by: Greg Kroah-Hartman --- include/linux/tty_driver.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/linux/tty_driver.h') diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index 3adc362f0bd2..1a85f003d646 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h @@ -391,6 +391,9 @@ static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d) * the requested timeout to the caller instead of using a simple * on/off interface. * + * TTY_DRIVER_DYNAMIC_ALLOC -- do not allocate structures which are + * needed per line for this driver as it would waste memory. + * The driver will take care. */ #define TTY_DRIVER_INSTALLED 0x0001 #define TTY_DRIVER_RESET_TERMIOS 0x0002 @@ -398,6 +401,7 @@ static inline struct tty_driver *tty_driver_kref_get(struct tty_driver *d) #define TTY_DRIVER_DYNAMIC_DEV 0x0008 #define TTY_DRIVER_DEVPTS_MEM 0x0010 #define TTY_DRIVER_HARDWARE_BREAK 0x0020 +#define TTY_DRIVER_DYNAMIC_ALLOC 0x0040 /* tty driver types */ #define TTY_DRIVER_TYPE_SYSTEM 0x0001 -- cgit v1.2.3-59-g8ed1b