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

Johan Hovold
2026-05-05T07:29:42Z

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>
---
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);