summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/button.c
diff options
context:
space:
mode:
authorLan Tianyu <tianyu.lan@intel.com>2013-09-12 09:32:03 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-09-25 17:11:57 +0200
commit763f527b68c6b026439f0b12ebe232d96b5563df (patch)
tree3ad79883006ca6a88d6c3ac102464aafe1b4f978 /drivers/acpi/button.c
parentACPI / osl: implement acpi_os_sleep() with msleep() (diff)
downloadlinux-763f527b68c6b026439f0b12ebe232d96b5563df.tar.xz
linux-763f527b68c6b026439f0b12ebe232d96b5563df.zip
ACPI / button: Using input_set_capability() to mark device's event capability
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 <tianyu.lan@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/button.c')
-rw-r--r--drivers/acpi/button.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c
index a55773801c5f..c971929d75c2 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;
}