[PATCH 18/20] spi: ti-qspi: cleanup registration error path

From: Johan Hovold

Date: Tue May 05 2026 - 03:34:44 EST


Add a proper error path for when registration fails so that the probe
tests for errors consistently.

Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
---
drivers/spi/spi-ti-qspi.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c
index 2a8548810f84..6b407c7b5d33 100644
--- a/drivers/spi/spi-ti-qspi.c
+++ b/drivers/spi/spi-ti-qspi.c
@@ -882,9 +882,12 @@ static int ti_qspi_probe(struct platform_device *pdev)
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);
--
2.53.0