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:
Krzysztof Chruscinski 2021-05-18 10:35:02 +02:00 committed by Kumar Gala
commit 7d61be9e79

View file

@ -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;