[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231117-axi-spi-engine-series-1-v1-6-cc59db999b87@baylibre.com>
Date: Fri, 17 Nov 2023 14:12:57 -0600
From: David Lechner <dlechner@...libre.com>
To: linux-spi@...r.kernel.org, devicetree@...r.kernel.org
Cc: David Lechner <dlechner@...libre.com>,
Mark Brown <broonie@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Michael Hennerich <Michael.Hennerich@...log.com>,
Nuno Sá <nuno.sa@...log.com>,
Lars-Peter Clausen <lars@...afoo.de>,
linux-kernel@...r.kernel.org
Subject: [PATCH 06/14] spi: axi-spi-engine: use devm_request_irq()
This replaces request_irq() with devm_request_irq() in the AXI SPI
Engine driver. This simplifies the error path and removes the need to
call free_irq() in the remove function.
Signed-off-by: David Lechner <dlechner@...libre.com>
---
drivers/spi/spi-axi-spi-engine.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-axi-spi-engine.c b/drivers/spi/spi-axi-spi-engine.c
index c18a4b34777e..81d7352d2b8b 100644
--- a/drivers/spi/spi-axi-spi-engine.c
+++ b/drivers/spi/spi-axi-spi-engine.c
@@ -520,7 +520,8 @@ static int spi_engine_probe(struct platform_device *pdev)
if (ret)
return ret;
- ret = request_irq(irq, spi_engine_irq, 0, pdev->name, host);
+ ret = devm_request_irq(&pdev->dev, irq, spi_engine_irq, 0, pdev->name,
+ host);
if (ret)
return ret;
@@ -533,24 +534,18 @@ static int spi_engine_probe(struct platform_device *pdev)
ret = spi_register_controller(host);
if (ret)
- goto err_free_irq;
+ return ret;
platform_set_drvdata(pdev, host);
return 0;
-err_free_irq:
- free_irq(irq, host);
- return ret;
}
static void spi_engine_remove(struct platform_device *pdev)
{
struct spi_controller *host = platform_get_drvdata(pdev);
- int irq = platform_get_irq(pdev, 0);
spi_unregister_controller(host);
-
- free_irq(irq, host);
}
static const struct of_device_id spi_engine_match_table[] = {
--
2.42.0
Powered by blists - more mailing lists