Skip to content

Commit 33e3ae7

Browse files
Tomasz Bursztykanashif
authored andcommitted
drivers/spi: Handle the case when tx buf/len is NULL/>0 in DW driver
This is a rare but valid case when you request the controller to send dummy bytes on your behalf (it saves memory as you don't need to provide a valid buffer, just NULL and the numbers of dummy bytes as length). Without it, user code can get stuck into interrupt loop. Signed-off-by: Tomasz Bursztyka <[email protected]>
1 parent 002031d commit 33e3ae7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/spi/spi_dw.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ static void push_data(struct device *dev)
125125
break;
126126
}
127127

128+
data = 0;
129+
} else if (spi_context_tx_on(&spi->ctx)) {
128130
data = 0;
129131
} else {
130132
/* Nothing to push anymore */

0 commit comments

Comments
 (0)