diff mbox series

[-next,1/3] spi: geni-qcom: Use devm_request_irq() helper

Message ID 20240904021943.2076343-2-ruanjinjie@huawei.com
State New
Headers show
Series [-next,1/3] spi: geni-qcom: Use devm_request_irq() helper | expand

Commit Message

Jinjie Ruan Sept. 4, 2024, 2:19 a.m. UTC
Since spi_geni_probe() use managed function in most places, also use
devm_request_irq() to request the interrupt, so we can avoid
having to manually clean this up.

Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
---
 drivers/spi/spi-geni-qcom.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c
index 37ef8c40b276..77eb874e4f54 100644
--- a/drivers/spi/spi-geni-qcom.c
+++ b/drivers/spi/spi-geni-qcom.c
@@ -1144,17 +1144,15 @@  static int spi_geni_probe(struct platform_device *pdev)
 	if (mas->cur_xfer_mode == GENI_GPI_DMA)
 		spi->flags = SPI_CONTROLLER_MUST_TX;
 
-	ret = request_irq(mas->irq, geni_spi_isr, 0, dev_name(dev), spi);
+	ret = devm_request_irq(dev, mas->irq, geni_spi_isr, 0, dev_name(dev), spi);
 	if (ret)
 		goto spi_geni_release_dma;
 
 	ret = spi_register_controller(spi);
 	if (ret)
-		goto spi_geni_probe_free_irq;
+		goto spi_geni_release_dma;
 
 	return 0;
-spi_geni_probe_free_irq:
-	free_irq(mas->irq, spi);
 spi_geni_release_dma:
 	spi_geni_release_dma_chan(mas);
 spi_geni_probe_runtime_disable:
@@ -1172,7 +1170,6 @@  static void spi_geni_remove(struct platform_device *pdev)
 
 	spi_geni_release_dma_chan(mas);
 
-	free_irq(mas->irq, spi);
 	pm_runtime_disable(&pdev->dev);
 }