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@xxxxxxxxxx> --- drivers/spi/spi-geni-qcom.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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); } -- 2.34.1