drivers: serial: nrf_uarte: Fix uart_callback_set unsupported handling
Function should return -ENOTSUP when asynchronous api is not supported by the device. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
parent
8af5dbc977
commit
7d61be9e79
1 changed files with 4 additions and 0 deletions
|
@ -878,6 +878,10 @@ static int uarte_nrfx_callback_set(const struct device *dev,
|
|||
{
|
||||
struct uarte_nrfx_data *data = get_dev_data(dev);
|
||||
|
||||
if (!data->async) {
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
data->async->user_callback = callback;
|
||||
data->async->user_data = user_data;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue