Skip to content

Commit b2a3e12

Browse files
pawelzadrozniakcarlescufi
authored andcommitted
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 <[email protected]>
1 parent 06ab394 commit b2a3e12

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/usb/device/usb_dc_nrfx.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,13 @@ static int hf_clock_enable(bool on, bool blocking)
557557
return 0;
558558
}
559559
ret = clock_control_off(clock, (void *)blocking);
560+
if (ret == -EBUSY) {
561+
/* This is an expected behaviour.
562+
* -EBUSY means that some other module has also
563+
* requested the clock to run.
564+
*/
565+
ret = 0;
566+
}
560567
}
561568

562569
if (ret && (blocking || (ret != -EINPROGRESS))) {

0 commit comments

Comments
 (0)