Skip to content

Commit fd90c9b

Browse files
Adrien MARTINaescolar
authored andcommitted
drivers: spi: gecko: propagate spi config error
This commit catch the return code of the spi_config function and early returns on error so that high level spi transfer api gets the error too. Signed-off-by: Adrien MARTIN <[email protected]>
1 parent f91700e commit fd90c9b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/spi/spi_gecko.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,13 @@ static int spi_gecko_transceive(const struct device *dev,
346346
{
347347
struct spi_gecko_data *data = dev->data;
348348
uint16_t control = 0;
349+
int ret;
350+
351+
ret = spi_config(dev, config, &control);
352+
if (ret < 0) {
353+
return ret;
354+
}
349355

350-
spi_config(dev, config, &control);
351356
spi_context_buffers_setup(&data->ctx, tx_bufs, rx_bufs, 1);
352357
spi_gecko_xfer(dev, config);
353358
return 0;

0 commit comments

Comments
 (0)