We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13a9693 commit 4294e4aCopy full SHA for 4294e4a
drivers/spi/spi-rockchip.c
@@ -291,7 +291,7 @@ static void rockchip_spi_pio_writer(struct rockchip_spi *rs)
291
static void rockchip_spi_pio_reader(struct rockchip_spi *rs)
292
{
293
u32 words = readl_relaxed(rs->regs + ROCKCHIP_SPI_RXFLR);
294
- u32 rx_left = rs->rx_left - words;
+ u32 rx_left = (rs->rx_left > words) ? rs->rx_left - words : 0;
295
296
/* the hardware doesn't allow us to change fifo threshold
297
* level while spi is enabled, so instead make sure to leave
0 commit comments