Skip to content

Commit c63443e

Browse files
joerchanrlubos
authored andcommitted
[nrf fromtree] drivers: nrf_qspi_nor: Check poll period before sleep
Check that the poll period is non-zero before sleeping. Signed-off-by: Joakim Andersson <[email protected]> (cherry picked from commit d794d58)
1 parent c386643 commit c63443e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/flash/nrf_qspi_nor.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,9 @@ static int qspi_wait_while_writing(const struct device *dev, k_timeout_t poll_pe
488488

489489
do {
490490
#ifdef CONFIG_MULTITHREADING
491-
k_sleep(poll_period);
491+
if (!K_TIMEOUT_EQ(poll_period, K_NO_WAIT)) {
492+
k_sleep(poll_period);
493+
}
492494
#endif
493495
rc = qspi_rdsr(dev, 1);
494496
} while ((rc >= 0)

0 commit comments

Comments
 (0)