]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
spi: ti-qspi: cleanup registration error path
authorJohan Hovold <johan@kernel.org>
Tue, 5 May 2026 07:29:07 +0000 (09:29 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 11 May 2026 00:55:53 +0000 (09:55 +0900)
Add a proper error path for when registration fails so that the probe
tests for errors consistently.

Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260505072909.618363-19-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-ti-qspi.c

index 2a8548810f8491c270d0e6a53aabd262b9c2dde5..6b407c7b5d336a3b867ee51498c266992b7f85a8 100644 (file)
@@ -882,9 +882,12 @@ no_dma:
        qspi->current_cs = -1;
 
        ret = spi_register_controller(host);
-       if (!ret)
-               return 0;
+       if (ret)
+               goto err_free_dma;
+
+       return 0;
 
+err_free_dma:
        ti_qspi_dma_cleanup(qspi);
 
        pm_runtime_disable(&pdev->dev);