From patchwork Tue Jan 24 23:06:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 6384 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id B1D7923E12 for ; Tue, 24 Jan 2012 23:07:08 +0000 (UTC) Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 982E8A18377 for ; Tue, 24 Jan 2012 23:07:08 +0000 (UTC) Received: by bkar19 with SMTP id r19so4709024bka.11 for ; Tue, 24 Jan 2012 15:07:08 -0800 (PST) Received: by 10.205.139.12 with SMTP id iu12mr5836270bkc.2.1327446428311; Tue, 24 Jan 2012 15:07:08 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.204.130.220 with SMTP id u28cs117329bks; Tue, 24 Jan 2012 15:07:08 -0800 (PST) Received: by 10.14.100.10 with SMTP id y10mr5036477eef.119.1327446426994; Tue, 24 Jan 2012 15:07:06 -0800 (PST) Received: from eu1sys200aog117.obsmtp.com (eu1sys200aog117.obsmtp.com. [207.126.144.143]) by mx.google.com with SMTP id n12si5069771eef.128.2012.01.24.15.06.57 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Jan 2012 15:07:06 -0800 (PST) Received-SPF: neutral (google.com: 207.126.144.143 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.143; Authentication-Results: mx.google.com; spf=neutral (google.com: 207.126.144.143 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) smtp.mail=linus.walleij@stericsson.com Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob117.postini.com ([207.126.147.11]) with SMTP ID DSNKTx85kRswCI7TQnMp9GnG0Ccz8rzQx5Zq@postini.com; Tue, 24 Jan 2012 23:07:04 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 2FC99AE; Tue, 24 Jan 2012 22:58:23 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id B6339A6C; Tue, 24 Jan 2012 23:06:50 +0000 (GMT) Received: from exdcvycastm003.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm003", Issuer "exdcvycastm003" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id 08B48A8065; Wed, 25 Jan 2012 00:06:50 +0100 (CET) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.1) with Microsoft SMTP Server (TLS) id 8.3.83.0; Wed, 25 Jan 2012 00:06:49 +0100 From: Linus Walleij To: Samuel Ortiz , , Grant Likely Cc: Viresh Kumar , Chris Blair Subject: [PATCH] gpio/stmpe: Correct cleanup for no-irq mode Date: Wed, 25 Jan 2012 00:06:43 +0100 Message-ID: <1327446403-11775-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.8 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQl6cnuiM53T25l/RN0SweuNYKu7cYHse4M+SfXrOlI+CufwgMXVq/q/vGkklOLURxfeA4x8 From: Chris Blair Corrects error condition and driver removal cleanup for the no-irq configuration. Cc: Viresh Kumar Cc: Grant Likely Signed-off-by: Chris Blair --- This depends on the previous patch to the MFD code so should better be merged into the MFD tree with the previous patch. --- drivers/gpio/gpio-stmpe.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c index 87a68a8..1008c7c 100644 --- a/drivers/gpio/gpio-stmpe.c +++ b/drivers/gpio/gpio-stmpe.c @@ -361,9 +361,11 @@ static int __devinit stmpe_gpio_probe(struct platform_device *pdev) return 0; out_freeirq: - free_irq(irq, stmpe_gpio); + if (!stmpe->pdata->no_irq) + free_irq(irq, stmpe_gpio); out_removeirq: - stmpe_gpio_irq_remove(stmpe_gpio); + if (!stmpe->pdata->no_irq) + stmpe_gpio_irq_remove(stmpe_gpio); out_disable: stmpe_disable(stmpe, STMPE_BLOCK_GPIO); out_free: @@ -391,8 +393,10 @@ static int __devexit stmpe_gpio_remove(struct platform_device *pdev) stmpe_disable(stmpe, STMPE_BLOCK_GPIO); - free_irq(irq, stmpe_gpio); - stmpe_gpio_irq_remove(stmpe_gpio); + if (!stmpe->pdata->no_irq) { + free_irq(irq, stmpe_gpio); + stmpe_gpio_irq_remove(stmpe_gpio); + } platform_set_drvdata(pdev, NULL); kfree(stmpe_gpio);