Skip to content

Commit ed177f5

Browse files
[nrf fromlist] drivers: spi: nrfx_spi: align to errno codes in nrfx
NRFX drivers now return errno codes, aligned driver. Upstream PR #: 97997 Signed-off-by: Michał Stasiak <[email protected]>
1 parent 1b30c69 commit ed177f5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

drivers/spi/spi_nrfx_spi.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static int configure(const struct device *dev,
9191
const struct spi_nrfx_config *dev_config = dev->config;
9292
struct spi_context *ctx = &dev_data->ctx;
9393
nrfx_spi_config_t config;
94-
nrfx_err_t result;
94+
int result;
9595
uint32_t sck_pin;
9696

9797
if (dev_data->initialized && spi_context_configured(ctx, spi_cfg)) {
@@ -149,8 +149,8 @@ static int configure(const struct device *dev,
149149

150150
result = nrfx_spi_init(&dev_config->spi, &config,
151151
event_handler, dev_data);
152-
if (result != NRFX_SUCCESS) {
153-
LOG_ERR("Failed to initialize nrfx driver: %08x", result);
152+
if (result != 0) {
153+
LOG_ERR("Failed to initialize nrfx driver: %d", result);
154154
return -EIO;
155155
}
156156

@@ -183,16 +183,15 @@ static void transfer_next_chunk(const struct device *dev)
183183

184184
if (chunk_len > 0) {
185185
nrfx_spi_xfer_desc_t xfer;
186-
nrfx_err_t result;
187186

188187
dev_data->chunk_len = chunk_len;
189188

190189
xfer.p_tx_buffer = ctx->tx_buf;
191190
xfer.tx_length = spi_context_tx_buf_on(ctx) ? chunk_len : 0;
192191
xfer.p_rx_buffer = ctx->rx_buf;
193192
xfer.rx_length = spi_context_rx_buf_on(ctx) ? chunk_len : 0;
194-
result = nrfx_spi_xfer(&dev_config->spi, &xfer, 0);
195-
if (result == NRFX_SUCCESS) {
193+
error = nrfx_spi_xfer(&dev_config->spi, &xfer, 0);
194+
if (error == 0) {
196195
return;
197196
}
198197

0 commit comments

Comments
 (0)