Skip to content
Commit 113b016b authored by Erwin Rol's avatar Erwin Rol Committed by Carles Cufí
Browse files

drivers: dma: stm32: change order of disabling and checking result



The stm32_dma_disable_stream first checked if the stream was
disabled and if so returned OK. If it wasn't disabled it
tried to disable it and returned -EAGAIN.

The function is used in loops that try to disable the stream
by calling this function and if it fails wait for 1ms and
retry.

Becuase this function the first time (if the stream wasn't
disabled already) fails there is always a 1 ms delay. For
the SPI driver, that has a RX and TX stream, this means
a 2ms delay between the last data and CS going high.

By first trying to disable the stream and than checking
if it succeded most of the time the first call disables
the stream and the 1ms delay isn't needed.

Signed-off-by: default avatarErwin Rol <erwin@erwinrol.com>
parent 65434f58
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment