drivers: serial: ns16550: Remove hard-coded max instance count

Instead of having a hard-coded maximum instance count, introduce a
Kconfig variable for it. The inclusion of the per-instance header
files is solved by having them chain-include each other with a
pre-processor condition that checks if the current header file is the
last one or not.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2020-12-21 15:32:45 +02:00 committed by Anas Nashif
commit 4fa0a9b4b2
4 changed files with 19 additions and 4 deletions

View file

@ -976,7 +976,8 @@ static const struct uart_driver_api uart_ns16550_driver_api = {
#endif
};
/* The instance-specific header files are chained together (each instance
* includes the next one, unless it's the last instance) so we only need to
* include the first instance.
*/
#include <uart_ns16550_port_0.h>
#include <uart_ns16550_port_1.h>
#include <uart_ns16550_port_2.h>
#include <uart_ns16550_port_3.h>