• L
    tty-ldisc: make /proc/tty/ldiscs use ldisc_ops instead of ldiscs · f0de0e8d
    Linus Torvalds 提交于
    The /proc/tty/ldiscs file is totally and utterly un-interested in the
    "struct tty_ldisc" structures, and only cares about the underlying ldisc
    operations.
    
    So don't make it create a dummy 'struct ldisc' only to get a pointer to
    the operations, and then destroy it.  Instead, we split up the function
    'tty_ldisc_try_get()', and create a 'get_ldops()' helper that just looks
    up the ldisc operations based on the ldisc number.
    
    That makes the code simpler to read (smaller and more well-defined
    helper functions), and allows the /proc functions to avoid creating that
    useless dummy only to immediately free it again.
    Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
    Tested-by: NSergey Senozhatsky <sergey.senozhatsky@mail.by>
    Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
    Cc: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
    Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
    f0de0e8d
tty_ldisc.c 21.3 KB