diff options
Diffstat (limited to 'payloads/libpayload/drivers/serial')
-rw-r--r-- | payloads/libpayload/drivers/serial/8250.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/payloads/libpayload/drivers/serial/8250.c b/payloads/libpayload/drivers/serial/8250.c index bca0057bb3..e9550f3e33 100644 --- a/payloads/libpayload/drivers/serial/8250.c +++ b/payloads/libpayload/drivers/serial/8250.c @@ -41,7 +41,7 @@ static uint8_t serial_read_reg(int offset) { offset *= lib_sysinfo.serial->regwidth; -#ifdef CONFIG_LP_IO_ADDRESS_SPACE +#if IS_ENABLED(CONFIG_LP_IO_ADDRESS_SPACE) if (!serial_is_mem_mapped) return inb(IOBASE + offset); else @@ -53,7 +53,7 @@ static void serial_write_reg(uint8_t val, int offset) { offset *= lib_sysinfo.serial->regwidth; -#ifdef CONFIG_LP_IO_ADDRESS_SPACE +#if IS_ENABLED(CONFIG_LP_IO_ADDRESS_SPACE) if (!serial_is_mem_mapped) outb(val, IOBASE + offset); else @@ -61,7 +61,7 @@ static void serial_write_reg(uint8_t val, int offset) writeb(val, MEMBASE + offset); } -#ifdef CONFIG_LP_SERIAL_SET_SPEED +#if IS_ENABLED(CONFIG_LP_SERIAL_SET_SPEED) static void serial_hardware_init(int speed, int word_bits, int parity, int stop_bits) { @@ -106,7 +106,7 @@ void serial_init(void) (lib_sysinfo.serial->type == CB_SERIAL_TYPE_MEMORY_MAPPED); if (!serial_is_mem_mapped) { -#ifdef CONFIG_LP_IO_ADDRESS_SPACE +#if IS_ENABLED(CONFIG_LP_IO_ADDRESS_SPACE) if ((inb(IOBASE + 0x05) == 0xFF) && (inb(IOBASE + 0x06) == 0xFF)) { printf("IO space mapped serial not present."); @@ -118,7 +118,7 @@ void serial_init(void) #endif } -#ifdef CONFIG_LP_SERIAL_SET_SPEED +#if IS_ENABLED(CONFIG_LP_SERIAL_SET_SPEED) serial_hardware_init(CONFIG_LP_SERIAL_BAUD_RATE, 8, 0, 1); #endif } |