Skip to content
Commit 6c717095 authored by Martí Bolívar's avatar Martí Bolívar Committed by Anas Nashif
Browse files

drivers: spi: report synchronous completion status



The SPI API allows waiters to block until SPI I/O has completed. The
asynchronous subset of the API allows waiters to learn a status value
for the result of the I/O. However, the synchronous API does not allow
this.

Due to this limitation, synchronous API users cannot learn when
interrupt-driven I/O fails, which precludes proper error handling.

Resolve this limitation by adding a sync_status field to struct
spi_context, and using it to return operation results to the waiter.

Since there is only one status field, reduce the maximum number of
supported waiters from UINT_MAX to 1. This is not a problem for
current users, which all wait with the entire context locked.

Signed-off-by: default avatarMarti Bolivar <marti.bolivar@linaro.org>
parent ec3aece9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment