From patchwork Thu Sep 12 07:32:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "lan,Tianyu" X-Patchwork-Id: 2876661 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 96B3CBF43F for ; Thu, 12 Sep 2013 07:33:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 03D3D202DB for ; Thu, 12 Sep 2013 07:33:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D56BA202E8 for ; Thu, 12 Sep 2013 07:33:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753399Ab3ILHdm (ORCPT ); Thu, 12 Sep 2013 03:33:42 -0400 Received: from mga09.intel.com ([134.134.136.24]:24034 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752785Ab3ILHdm (ORCPT ); Thu, 12 Sep 2013 03:33:42 -0400 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 12 Sep 2013 00:30:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.90,889,1371106800"; d="scan'208";a="402180069" Received: from unknown (HELO localhost) ([10.255.20.210]) by orsmga002.jf.intel.com with ESMTP; 12 Sep 2013 00:33:40 -0700 From: tianyu.lan@intel.com To: tianyu.lan@intel.com, lenb@kernel.org, rjw@sisk.pl, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] ACPI/Button: Using input_set_capability() to mark device's event capability Date: Thu, 12 Sep 2013 03:32:03 -0400 Message-Id: <1378971125-8896-2-git-send-email-tianyu.lan@intel.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1378971125-8896-1-git-send-email-tianyu.lan@intel.com> References: <1378971125-8896-1-git-send-email-tianyu.lan@intel.com> 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.8 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 From: Lan Tianyu Input layer provides input_set_capability() to set input device's event related bits. This patch is to use it to replace origin code. Signed-off-by: Lan Tianyu --- drivers/acpi/button.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index a557738..c971929 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c @@ -383,18 +383,15 @@ static int acpi_button_add(struct acpi_device *device) switch (button->type) { case ACPI_BUTTON_TYPE_POWER: - input->evbit[0] = BIT_MASK(EV_KEY); - set_bit(KEY_POWER, input->keybit); + input_set_capability(input, EV_KEY, KEY_POWER); break; case ACPI_BUTTON_TYPE_SLEEP: - input->evbit[0] = BIT_MASK(EV_KEY); - set_bit(KEY_SLEEP, input->keybit); + input_set_capability(input, EV_KEY, KEY_SLEEP); break; case ACPI_BUTTON_TYPE_LID: - input->evbit[0] = BIT_MASK(EV_SW); - set_bit(SW_LID, input->swbit); + input_set_capability(input, EV_SW, SW_LID); break; }