spi: spi-dw-dma: fix print error log when wait finish transaction

If an error occurs, the device may not have a current message. In this
case, the system will crash.

In this case, it's better to use dev from the struct ctlr (struct spi_controller*).

Signed-off-by: Vladimir Yakovlev <vovchkir@gmail.com>
Link: https://patch.msgid.link/20260302222017.992228-2-vovchkir@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Vladimir Yakovlev 2026-03-03 01:20:17 +03:00 committed by Mark Brown
parent 11439c4635
commit 3b46d61890
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -271,7 +271,7 @@ static int dw_spi_dma_wait(struct dw_spi *dws, unsigned int len, u32 speed)
msecs_to_jiffies(ms));
if (ms == 0) {
dev_err(&dws->ctlr->cur_msg->spi->dev,
dev_err(&dws->ctlr->dev,
"DMA transaction timed out\n");
return -ETIMEDOUT;
}