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 <kumar.gala@linaro.org>
This commit is contained in:
parent
ccb5a01fc1
commit
5999787e6e
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue