drivers: usb: nordic: Do not log an error if HFCLK is busy

HFCLK may be requested for multiple modules, i.e. Bluetooth stack.
When any other module has requested HFCLK to run, the driver will
return -EBUSY on free attempt which is not an error - thie means
that free request has been processed, but someone else is still
requiring the clock to run. When all clock users free the clock,
it may be disabled.

Related issue: #15145

Signed-off-by: Paweł Zadrożniak <pawel.zadrozniak@nordicsemi.no>
This commit is contained in:
Paweł Zadrożniak 2019-04-08 17:21:46 +02:00 committed by Carles Cufí
commit b2a3e12d86

View file

@ -557,6 +557,13 @@ static int hf_clock_enable(bool on, bool blocking)
return 0;
}
ret = clock_control_off(clock, (void *)blocking);
if (ret == -EBUSY) {
/* This is an expected behaviour.
* -EBUSY means that some other module has also
* requested the clock to run.
*/
ret = 0;
}
}
if (ret && (blocking || (ret != -EINPROGRESS))) {