diff mbox

spi: spi-imx: Do not store the irq number in the private structure

Message ID 1419889131-15472-1-git-send-email-festevam@gmail.com (mailing list archive)
State Accepted
Commit 4b5d6aadce5e054d33719a7490076294c83d2f88
Headers show

Commit Message

Fabio Estevam Dec. 29, 2014, 9:38 p.m. UTC
From: Fabio Estevam <fabio.estevam@freescale.com>

The irq number is only used inside the probe function, so there is really no
need to store it in the private structure.

Use a local 'irq' variable to hold the the irq number instead.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/spi/spi-imx.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

Comments

Mark Brown Dec. 30, 2014, 11:25 a.m. UTC | #1
On Mon, Dec 29, 2014 at 07:38:51PM -0200, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> The irq number is only used inside the probe function, so there is really no
> need to store it in the private structure.

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index 961b97d..6a2ff75 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -89,7 +89,6 @@  struct spi_imx_data {
 
 	struct completion xfer_done;
 	void __iomem *base;
-	int irq;
 	struct clk *clk_per;
 	struct clk *clk_ipg;
 	unsigned long spi_clk;
@@ -1076,7 +1075,7 @@  static int spi_imx_probe(struct platform_device *pdev)
 	struct spi_master *master;
 	struct spi_imx_data *spi_imx;
 	struct resource *res;
-	int i, ret, num_cs;
+	int i, ret, num_cs, irq;
 
 	if (!np && !mxc_platform_info) {
 		dev_err(&pdev->dev, "can't get the platform data\n");
@@ -1143,16 +1142,16 @@  static int spi_imx_probe(struct platform_device *pdev)
 		goto out_master_put;
 	}
 
-	spi_imx->irq = platform_get_irq(pdev, 0);
-	if (spi_imx->irq < 0) {
-		ret = spi_imx->irq;
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0) {
+		ret = irq;
 		goto out_master_put;
 	}
 
-	ret = devm_request_irq(&pdev->dev, spi_imx->irq, spi_imx_isr, 0,
+	ret = devm_request_irq(&pdev->dev, irq, spi_imx_isr, 0,
 			       dev_name(&pdev->dev), spi_imx);
 	if (ret) {
-		dev_err(&pdev->dev, "can't get irq%d: %d\n", spi_imx->irq, ret);
+		dev_err(&pdev->dev, "can't get irq%d: %d\n", irq, ret);
 		goto out_master_put;
 	}