Commit 54d55220 authored by Vojtech Pavlik's avatar Vojtech Pavlik

input: Fix a few conditions in power.c, which kept it from doint

       anything at all.
Found-by: default avatarBJ Douma <bjdouma@xs4all.nl>
Signed-off-by: default avatarVojtech Pavlik <vojtech@suse.cz>
parent 12752be2
...@@ -58,8 +58,6 @@ static void power_event(struct input_handle *handle, unsigned int type, ...@@ -58,8 +58,6 @@ static void power_event(struct input_handle *handle, unsigned int type,
printk("Entering power_event\n"); printk("Entering power_event\n");
if (type != EV_KEY || type != EV_PWR) return;
if (type == EV_PWR) { if (type == EV_PWR) {
switch (code) { switch (code) {
case KEY_SUSPEND: case KEY_SUSPEND:
...@@ -76,7 +74,9 @@ static void power_event(struct input_handle *handle, unsigned int type, ...@@ -76,7 +74,9 @@ static void power_event(struct input_handle *handle, unsigned int type,
default: default:
return; return;
} }
} else { }
if (type == EV_KEY) {
switch (code) { switch (code) {
case KEY_SUSPEND: case KEY_SUSPEND:
printk("Powering down input device\n"); printk("Powering down input device\n");
...@@ -103,12 +103,6 @@ static struct input_handle *power_connect(struct input_handler *handler, ...@@ -103,12 +103,6 @@ static struct input_handle *power_connect(struct input_handler *handler,
{ {
struct input_handle *handle; struct input_handle *handle;
if (!test_bit(EV_KEY, dev->evbit) || !test_bit(EV_PWR, dev->evbit))
return NULL;
if (!test_bit(KEY_SUSPEND, dev->keybit) || (!test_bit(KEY_POWER, dev->keybit)))
return NULL;
if (!(handle = kmalloc(sizeof(struct input_handle), GFP_KERNEL))) if (!(handle = kmalloc(sizeof(struct input_handle), GFP_KERNEL)))
return NULL; return NULL;
memset(handle, 0, sizeof(struct input_handle)); memset(handle, 0, sizeof(struct input_handle));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment