From 5999787e6e9130753d3ac05f059824922f22d49c Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Mon, 20 Apr 2020 09:50:00 -0500 Subject: [PATCH] drivers: spi: spi_stm32: Convert DT_COMPAT_ define usage to new macros Convert driver from using DT_COMPAT_ST_STM32_SPI_FIFO to new macro DT_HAS_COMPAT(st_stm32_spi_fifo). Signed-off-by: Kumar Gala --- drivers/spi/spi_ll_stm32.c | 6 +++--- drivers/spi/spi_ll_stm32.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi_ll_stm32.c b/drivers/spi/spi_ll_stm32.c index fff9f4bef4..85b2c90aa1 100644 --- a/drivers/spi/spi_ll_stm32.c +++ b/drivers/spi/spi_ll_stm32.c @@ -197,7 +197,7 @@ static void spi_stm32_complete(struct spi_stm32_data *data, SPI_TypeDef *spi, spi_context_cs_control(&data->ctx, false); -#if defined(DT_COMPAT_ST_STM32_SPI_FIFO) +#if DT_HAS_COMPAT(st_stm32_spi_fifo) /* Flush RX buffer */ while (ll_func_rx_is_not_empty(spi)) { (void) LL_SPI_ReceiveData8(spi); @@ -344,7 +344,7 @@ static int spi_stm32_configure(struct device *dev, LL_SPI_SetDataWidth(spi, LL_SPI_DATAWIDTH_16BIT); } -#if defined(DT_COMPAT_ST_STM32_SPI_FIFO) +#if DT_HAS_COMPAT(st_stm32_spi_fifo) ll_func_set_fifo_threshold_8bit(spi); #endif @@ -409,7 +409,7 @@ static int transceive(struct device *dev, /* Set buffers info */ spi_context_buffers_setup(&data->ctx, tx_bufs, rx_bufs, 1); -#if defined(DT_COMPAT_ST_STM32_SPI_FIFO) +#if DT_HAS_COMPAT(st_stm32_spi_fifo) /* Flush RX buffer */ while (ll_func_rx_is_not_empty(spi)) { (void) LL_SPI_ReceiveData8(spi); diff --git a/drivers/spi/spi_ll_stm32.h b/drivers/spi/spi_ll_stm32.h index acc7b2054c..afac10917c 100644 --- a/drivers/spi/spi_ll_stm32.h +++ b/drivers/spi/spi_ll_stm32.h @@ -116,7 +116,7 @@ static inline u32_t ll_func_spi_is_busy(SPI_TypeDef *spi) /* Header is compiled first, this switch avoid the compiler to lookup for * non-existing LL FIFO functions for SoC without SPI FIFO */ -#ifdef DT_COMPAT_ST_STM32_SPI_FIFO +#if DT_HAS_COMPAT(st_stm32_spi_fifo) static inline void ll_func_set_fifo_threshold_8bit(SPI_TypeDef *spi) { #ifdef CONFIG_SOC_SERIES_STM32MP1X