From b44b96a060f3fd06456214cac7dfdd3ddf0caf2b Mon Sep 17 00:00:00 2001 From: Sam Povilus Date: Wed, 15 Mar 2017 20:43:24 -0600 Subject: [PATCH] uartlite: Adding a kernel parameter for the number of uartlites The number of uartlites should be set by a kernel parameter instead of using a #define. This allows the user to set the number of uartlites using only kconfig and not modifying kernel source. The uartlite is used by FPGAs that support a basically unlimited number of uarts so limiting it at 16 dosn't make sense as users might need more than that. Signed-off-by: Sam Povilus Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/Kconfig | 9 +++++++++ drivers/tty/serial/uartlite.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index d8495b9..896f5eb 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -630,6 +630,15 @@ config SERIAL_UARTLITE_CONSOLE console (the system console is the device which receives all kernel messages and warnings and which allows logins in single user mode). +config SERIAL_UARTLITE_NR_UARTS + int "Maximum number of uartlite serial ports" + depends on SERIAL_UARTLITE + range 1 256 + default 1 + help + Set this to the number of uartlites in your system, or the number + you think you might implement. + config SERIAL_SUNCORE bool depends on SPARC diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c index 817bb0d..c9b8d70 100644 --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c @@ -28,7 +28,7 @@ #define ULITE_NAME "ttyUL" #define ULITE_MAJOR 204 #define ULITE_MINOR 187 -#define ULITE_NR_UARTS 16 +#define ULITE_NR_UARTS CONFIG_SERIAL_UARTLITE_NR_UARTS /* --------------------------------------------------------------------- * Register definitions -- 2.7.4