From patchwork Mon Dec 29 21:38:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 5550351 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BA4A69F2B9 for ; Mon, 29 Dec 2014 21:39:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8DF4920172 for ; Mon, 29 Dec 2014 21:39:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9E7562017A for ; Mon, 29 Dec 2014 21:39:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752107AbaL2VjL (ORCPT ); Mon, 29 Dec 2014 16:39:11 -0500 Received: from mail-vc0-f173.google.com ([209.85.220.173]:53583 "EHLO mail-vc0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751560AbaL2VjK (ORCPT ); Mon, 29 Dec 2014 16:39:10 -0500 Received: by mail-vc0-f173.google.com with SMTP id kv19so5308542vcb.32 for ; Mon, 29 Dec 2014 13:39:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=J2My3loDE15Qb3sk80ApbI5E6jGMf1mMjobkozE+d0w=; b=pXceKd+fTsV+ylCrIb7GI8h3v2hHUwWP2jPxqq0+Hg1st5UyCFOv6ujqYcYL4IdHMS YRniDxKxHguf3+LroZNpSIAm9sfulSCaxfmTzs3OVB3f2Vpw6+EmdJ3Y4VqyMYwzo9C5 ouKBdaHK9VZSFZTTsEzrUAoOwwUiPc5fdJCtvDhDXG7I1kXrpdkqag405VabgcXxqRa2 /zuxrh75/MYwcK39P8gxN0B94N0YTXsD90A+pTsrsL2oZrWR/ubdkLAISxV/ldaKjpnm 49cjIeUBUHtSSb41i4QmS7R4R+jWgNOiq5FZoqZgGCu8XmHjVTyoDxxhs0JJJEU32XBa YdTg== X-Received: by 10.52.248.3 with SMTP id yi3mr27147320vdc.26.1419889149620; Mon, 29 Dec 2014 13:39:09 -0800 (PST) Received: from localhost.localdomain ([189.101.176.228]) by mx.google.com with ESMTPSA id oh11sm10462269vdb.9.2014.12.29.13.39.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Dec 2014 13:39:08 -0800 (PST) From: Fabio Estevam To: broonie@kernel.org Cc: linux-spi@vger.kernel.org, Fabio Estevam Subject: [PATCH] spi: spi-imx: Do not store the irq number in the private structure Date: Mon, 29 Dec 2014 19:38:51 -0200 Message-Id: <1419889131-15472-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam 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 --- drivers/spi/spi-imx.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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; }