From patchwork Thu Jan 15 02:00:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 5636461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D83AAC058D for ; Thu, 15 Jan 2015 02:03:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 10085201C8 for ; Thu, 15 Jan 2015 02:03:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5522C2011D for ; Thu, 15 Jan 2015 02:03:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YBZkh-00046w-8f; Thu, 15 Jan 2015 02:01:39 +0000 Received: from mail-ie0-x230.google.com ([2607:f8b0:4001:c03::230]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YBZkE-0003dx-Rl for linux-arm-kernel@lists.infradead.org; Thu, 15 Jan 2015 02:01:11 +0000 Received: by mail-ie0-f176.google.com with SMTP id tr6so12458578ieb.7 for ; Wed, 14 Jan 2015 18:00:48 -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=DdULrT8XIyk/zaZOVh/fBDrY82T77/hZHTobadfVgBs=; b=wfC2GPWJnzQ7k6RxdIUVBZ9uupQcqmMovC3W8wKILvEQ7zaHlUaoAYhYeFV0FH0A3E S0u3ha4OS5XHB4HZwt/hLI2Yk+fgCaEzCfexackXomFc0iDq80qQERNXtmwBlR8Hc8zd hTUvNjl7o3MXABemo7ZOjlhiiEooYZIP3QgJfeEmWKSpHhoBNS2Dp2eV0DeHNxUlzHEt gknTESqTYPy4TJm1EtRzQ4YWxtFeI8WAGSABeNYI4dAIvJ0da/IcbzlEVUiAOG6fU4o4 b0W/YfWS7ohMRlzUd2BlnrWJfY1zCA5OShdkN9iwSCf+wKIiENaoggskbfxW3V5XER9U gqIQ== X-Received: by 10.42.175.3 with SMTP id ay3mr487808icb.58.1421287248593; Wed, 14 Jan 2015 18:00:48 -0800 (PST) Received: from fangorn.rup.mentorg.com (nat-min.mentorg.com. [139.181.32.34]) by mx.google.com with ESMTPSA id f9sm110071iod.24.2015.01.14.18.00.46 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Jan 2015 18:00:47 -0800 (PST) From: Dmitry Eremin-Solenikov To: Sebastian Reichel Subject: [PATCH RESEND V2 1/2] power: gpio-charger: balance enable/disable_irq_wake calls Date: Thu, 15 Jan 2015 05:00:37 +0300 Message-Id: <1421287238-23522-1-git-send-email-dbaryshkov@gmail.com> X-Mailer: git-send-email 2.1.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150114_180111_031165_3631BEB9 X-CRM114-Status: GOOD ( 10.21 ) X-Spam-Score: -0.8 (/) Cc: stable@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, 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 enable_irq_wakeup returns 0 in case it correctly enabled the IRQ to generate the wakeup event (and thus resume should call disable_irq_wake). Currently gpio-charger driver has this logic inverted. Correct that thus correcting enable/disable_irq_wake() calls balance. Cc: stable@vger.kernel.org Signed-off-by: Dmitry Eremin-Solenikov --- drivers/power/gpio-charger.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/power/gpio-charger.c b/drivers/power/gpio-charger.c index 7536933..e5deb11 100644 --- a/drivers/power/gpio-charger.c +++ b/drivers/power/gpio-charger.c @@ -168,7 +168,7 @@ static int gpio_charger_suspend(struct device *dev) if (device_may_wakeup(dev)) gpio_charger->wakeup_enabled = - enable_irq_wake(gpio_charger->irq); + !enable_irq_wake(gpio_charger->irq); return 0; } @@ -178,7 +178,7 @@ static int gpio_charger_resume(struct device *dev) struct platform_device *pdev = to_platform_device(dev); struct gpio_charger *gpio_charger = platform_get_drvdata(pdev); - if (gpio_charger->wakeup_enabled) + if (device_may_wakeup(dev) && gpio_charger->wakeup_enabled) disable_irq_wake(gpio_charger->irq); power_supply_changed(&gpio_charger->charger);