]> git.baikalelectronics.ru Git - kernel.git/commit
serial: define FIXED_PORT flag for serial_core
authorDavid Gibson <david@gibson.dropbear.id.au>
Sun, 6 May 2007 21:48:49 +0000 (14:48 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 7 May 2007 19:12:50 +0000 (12:12 -0700)
commit701725da1ceffcef67225156d9a32e045c62c505
treee62e2ae859f235667eb2002ef9dd651e7c7a8ea0
parent51af536346674e1a19009bf81ac69542335c66da
serial: define FIXED_PORT flag for serial_core

At present, the serial core always allows setserial in userspace to change the
port address, irq and base clock of any serial port.  That makes sense for
legacy ISA ports, but not for (say) embedded ns16550 compatible serial ports
at peculiar addresses.  In these cases, the kernel code configuring the ports
must know exactly where they are, and their clocking arrangements (which can
be unusual on embedded boards).  It doesn't make sense for userspace to change
these settings.

Therefore, this patch defines a UPF_FIXED_PORT flag for the uart_port
structure.  If this flag is set when the serial port is configured, any
attempts to alter the port's type, io address, irq or base clock with
setserial are ignored.

In addition this patch uses the new flag for on-chip serial ports probed in
arch/powerpc/kernel/legacy_serial.c, and for other hard-wired serial ports
probed by drivers/serial/of_serial.c.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/powerpc/kernel/legacy_serial.c
drivers/serial/of_serial.c
drivers/serial/serial_core.c
include/linux/serial_core.h