[PATCH] spi: spi-dw-dma: fix print error log when wait finish transaction
From: Vladimir Yakovlev
Date: Mon Mar 02 2026 - 06:36:31 EST
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 host.
Signed-off-by: Vladimir Yakovlev <vovchkir@xxxxxxxxx>
---
drivers/spi/spi-dw-dma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-dw-dma.c b/drivers/spi/spi-dw-dma.c
index 65adec7c7524..d83466166abe 100644
--- a/drivers/spi/spi-dw-dma.c
+++ b/drivers/spi/spi-dw-dma.c
@@ -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->host->dev,
"DMA transaction timed out\n");
return -ETIMEDOUT;
}
--
2.34.1