Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3f139b6 authored by Jassi Brar's avatar Jassi Brar Committed by Grant Likely
Browse files

spi/s3c64xx: Fix incorrect reuse of 'val' local variable.



Instead of, wrongly, reusing the 'val' variable, use a dedicated
one for reading the status register.

Signed-off-by: default avatarJassi Brar <jassi.brar@samsung.com>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent 251ee478
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -326,10 +326,11 @@ static int wait_for_xfer(struct s3c64xx_spi_driver_data *sdd,
		val = msecs_to_jiffies(ms) + 10;
		val = wait_for_completion_timeout(&sdd->xfer_completion, val);
	} else {
		u32 status;
		val = msecs_to_loops(ms);
		do {
			val = readl(regs + S3C64XX_SPI_STATUS);
		} while (RX_FIFO_LVL(val, sci) < xfer->len && --val);
			status = readl(regs + S3C64XX_SPI_STATUS);
		} while (RX_FIFO_LVL(status, sci) < xfer->len && --val);
	}

	if (!val)