printk("Entering power_event\n");
- if (type != EV_KEY || type != EV_PWR) return;
-
if (type == EV_PWR) {
switch (code) {
case KEY_SUSPEND:
default:
return;
}
- } else {
+ }
+
+ if (type == EV_KEY) {
switch (code) {
case KEY_SUSPEND:
printk("Powering down input device\n");
{
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)))
return NULL;
memset(handle, 0, sizeof(struct input_handle));