Skip to content

Commit 3b856cc

Browse files
etienne-lmskartben
authored andcommitted
drivers: spi: stm32: replace an #if with an if() in transceive()
Replace a #ifndef directive with a if(!IS_ENABLED()) instrcution in transceive() function. This change makes later integration of RTIO support in this function smoother, polluting a bit less this function with #if based directives. Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
1 parent 21827ce commit 3b856cc

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

drivers/spi/spi_ll_stm32.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -975,11 +975,9 @@ static int transceive(const struct device *dev,
975975
return 0;
976976
}
977977

978-
#ifndef CONFIG_SPI_STM32_INTERRUPT
979-
if (asynchronous) {
978+
if (!IS_ENABLED(CONFIG_SPI_STM32_INTERRUPT) && asynchronous) {
980979
return -ENOTSUP;
981980
}
982-
#endif /* CONFIG_SPI_STM32_INTERRUPT */
983981

984982
spi_context_lock(&data->ctx, asynchronous, cb, userdata, config);
985983

0 commit comments

Comments
 (0)