From patchwork Fri Dec 6 08:32:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lan,Tianyu" X-Patchwork-Id: 3293451 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 441EDC0D4A for ; Fri, 6 Dec 2013 08:33:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2D1C520489 for ; Fri, 6 Dec 2013 08:33:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F20D42049C for ; Fri, 6 Dec 2013 08:33:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755190Ab3LFIdE (ORCPT ); Fri, 6 Dec 2013 03:33:04 -0500 Received: from mga09.intel.com ([134.134.136.24]:3378 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751624Ab3LFIdC (ORCPT ); Fri, 6 Dec 2013 03:33:02 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 06 Dec 2013 00:29:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,839,1378882800"; d="scan'208";a="447864750" Received: from unknown (HELO localhost) ([10.255.21.72]) by orsmga002.jf.intel.com with ESMTP; 06 Dec 2013 00:33:00 -0800 From: Lan Tianyu To: lenb@kernel.org, rjw@rjwysocki.net Cc: Lan Tianyu , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [Update PATCH] ACPI/Button: Fix enable Button GPEs twice Date: Fri, 6 Dec 2013 16:32:40 +0800 Message-Id: <1386318760-5887-1-git-send-email-tianyu.lan@intel.com> X-Mailer: git-send-email 1.8.2.1 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Button GPEs have been enabled in the acpi_wake_device_init() during boot and Button driver enables these GPEs second time. This causes disabling these gpes via sysfs interface requires twice "echo disable > /sys/firmware/acpi/interrupts/gpeXXX". This patch is to remove related code in the Button driver. Signed-off-by: Lan Tianyu --- Update: fix a typo, sorry for noise. drivers/acpi/button.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 9e3a6cb..6643f2d 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -406,15 +406,9 @@ static int acpi_button_add(struct acpi_device *device) lid_device = device; } - if (device->wakeup.flags.valid) { - /* Button's GPE is run-wake GPE */ - acpi_enable_gpe(device->wakeup.gpe_device, - device->wakeup.gpe_number); - if (!device_may_wakeup(&device->dev)) { - device_set_wakeup_enable(&device->dev, true); - button->wakeup_enabled = true; - } - } + /* Button GPEs have been enabled in the acpi_wakeup_device_list()*/ + if (device->wakeup.flags.valid) + button->wakeup_enabled = true; printk(KERN_INFO PREFIX "%s [%s]\n", name, acpi_device_bid(device)); return 0;