Re: [PATCH v2 2/8] spi: rockchip: Wait for STB status in slave mode tx_xfer

From: Sascha Hauer
Date: Wed May 05 2021 - 03:59:56 EST


Hi Jon Lin,

On Tue, Apr 27, 2021 at 03:37:27PM +0800, Jon Lin wrote:
> +static inline void wait_for_tx_idle(struct rockchip_spi *rs, bool slave_mode)
> {
> unsigned long timeout = jiffies + msecs_to_jiffies(5);
>
> do {
> - if (!(readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY))
> - return;
> + if (slave_mode) {
> + if (!(readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_SLAVE_TX_BUSY) &&
> + !((readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY))
> + return;

This doesn't compile. There is one opening brace too much before the
readl_relaxed.

Regards,
Sascha

--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |