From patchwork Fri Dec 6 06:47:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lan,Tianyu" X-Patchwork-Id: 3293291 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 8C85CC0D4A for ; Fri, 6 Dec 2013 06:47:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 88FDD2045A for ; Fri, 6 Dec 2013 06:47:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B52A520453 for ; Fri, 6 Dec 2013 06:47:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751275Ab3LFGrW (ORCPT ); Fri, 6 Dec 2013 01:47:22 -0500 Received: from mga02.intel.com ([134.134.136.20]:39645 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750752Ab3LFGrW (ORCPT ); Fri, 6 Dec 2013 01:47:22 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 05 Dec 2013 22:47:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.93,839,1378882800"; d="scan'208";a="420314763" Received: from unknown (HELO localhost) ([10.255.21.72]) by orsmga001.jf.intel.com with ESMTP; 05 Dec 2013 22:47:16 -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: [PATCH] ACPI/Button: Fix enable Button GPEs twice Date: Fri, 6 Dec 2013 14:47:14 +0800 Message-Id: <1386312434-3476-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 --- 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 enalbed 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;