]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
spi: spi-dw-dma: fix print error log when wait finish transaction
authorVladimir Yakovlev <vovchkir@gmail.com>
Mon, 2 Mar 2026 22:20:17 +0000 (01:20 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 2 Mar 2026 22:33:32 +0000 (22:33 +0000)
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>
drivers/spi/spi-dw-dma.c

index 65adec7c7524b8362ec63be556a5a6ba8ab53a99..fe726b9b1780d2642b46e80f63d105f7c6c372ec 100644 (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;
        }