From: Linus Torvalds Date: Mon, 3 Aug 2009 23:00:15 +0000 (-0700) Subject: tty-ldisc: make /proc/tty/ldiscs use ldisc_ops instead of ldiscs X-Git-Tag: v2.6.32-rc1~627^2~75 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0de0e8d3565ee7feba6228d99763d4cea2087a6;p=pandora-kernel.git tty-ldisc: make /proc/tty/ldiscs use ldisc_ops instead of ldiscs 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: Linus Torvalds Tested-by: Sergey Senozhatsky Cc: Alan Cox Cc: OGAWA Hirofumi Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed