lkml.org 
[lkml]   [2014]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH 2/2] serial: pl011: Move uart_register_driver call to device probe
And an even simpler broad brush approach will also work I think (untested)

The "zero crap" approach....

commit c5cd0be0576ba9059799ef5383402ff6ffc212a3
Author: Alan <gnomes@lxorguk.ukuu.org.uk>
Date: Mon Feb 17 15:52:21 2014 +0000

tty: Allow serial port allocations to be fully dynamic

This switch allows platforms to make their serial port allocations entirely
dynamic as is needed on some non-x86 platforms which have overlapping static
minor numbers between some of their devices.

Default to the old static allocations for maximum compatibility with ancient
userspace.

Signed-off-by: Alan Cox <alan@linux.intel.com>

diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig
index 65cd80b..670c076 100644
--- a/drivers/tty/Kconfig
+++ b/drivers/tty/Kconfig
@@ -166,6 +166,16 @@ config LEGACY_PTY_COUNT
When not in use, each legacy PTY occupies 12 bytes on 32-bit
architectures and 24 bytes on 64-bit architectures.

+config TTY_SERIAL_LEGACY
+ bool "Allocate legacy fixed minor numbers for serial ports"
+ default y
+ ---help---
+ Modern linux dynamically allocates device numbers. Some very old
+ Linux distributions only support static device numbering.
+ Selecting this option will enable support for very old
+ userspace but on some non PC architectures may prevent you building
+ a single kernel for multiple machines.
+
config BFIN_JTAG_COMM
tristate "Blackfin JTAG Communication"
depends on BLACKFIN
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index ece2049..b78afc1 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2315,8 +2315,10 @@ int uart_register_driver(struct uart_driver *drv)

normal->driver_name = drv->driver_name;
normal->name = drv->dev_name;
+#ifdef CONFIG_TTY_SERIAL_LEGACY
normal->major = drv->major;
normal->minor_start = drv->minor;
+#endif
normal->type = TTY_DRIVER_TYPE_SERIAL;
normal->subtype = SERIAL_TYPE_NORMAL;
normal->init_termios = tty_std_termios;

\
 
 \ /
  Last update: 2014-02-17 17:21    [W:0.116 / U:0.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site