]> git.hungrycats.org Git - linux/commit
[PATCH] console cleanup (2/2)
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
Thu, 24 Apr 2003 15:38:39 +0000 (08:38 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Thu, 24 Apr 2003 15:38:39 +0000 (08:38 -0700)
commit4310d2e1ef9d2fa109ee2b6a01cf47e81acc3432
tree1502bca99251d19704f6006f4ce11a2aeddf1fc0
parentb7d752fb6dc63357ed6673181a8afd4b169488df
[PATCH] console cleanup (2/2)

Console drivers cleanup.  In current tree interaction between
console and tty layer sits in the ->device() method of struct console.
It takes a pointer to console and returns device number of its tty
device.  open(2) on /dev/console goes through the list of registered
consoles, picks the first one that has ->device() and remaps the device
number to console->device(console).  Then it proceeds with normal
opening of tty.  This is the only caller of ->device().

Cleanup: let ->device() return a pair (pointer to tty_driver, index
of tty in question) instead of device number.  Note that
a) the first thing tty_open() does with remapped device number is
conversion to such pair.
b) console driver _knows_ which tty_driver we want - one that
implements tty interface to the same physical device (i.e. the part of
the same driver).
c) current code expects the result of ->device() to be a device
number of tty device - anything else is immediate -ENODEV from tty_open();
might as well have NULL ->device in that driver.

Console drivers converted, (the only) caller updated.
36 files changed:
arch/alpha/kernel/srmcons.c
arch/ia64/hp/sim/hpsim_console.c
arch/ia64/hp/sim/simserial.c
arch/m68k/sun3x/prom.c
arch/mips/au1000/common/serial.c
arch/mips/baget/vacserial.c
arch/mips/kernel/gdb-stub.c
arch/ppc/4xx_io/serial_sicc.c
arch/ppc/8260_io/uart.c
arch/ppc/8xx_io/uart.c
arch/sh/kernel/setup.c
arch/um/drivers/stdio_console.c
arch/v850/kernel/memcons.c
arch/v850/kernel/simcons.c
drivers/char/amiserial.c
drivers/char/dz.c
drivers/char/hvc_console.c
drivers/char/lp.c
drivers/char/lp_old98.c
drivers/char/serial167.c
drivers/char/serial_tx3912.c
drivers/char/sh-sci.c
drivers/char/tty_io.c
drivers/char/vme_scc.c
drivers/char/vt.c
drivers/macintosh/macserial.c
drivers/s390/char/con3215.c
drivers/s390/char/tuball.c
drivers/serial/68328serial.c
drivers/serial/68360serial.c
drivers/serial/core.c
drivers/serial/mcfserial.c
drivers/sgi/char/sgiserial.c
drivers/tc/zs.c
include/linux/console.h
include/linux/serial_core.h