diff options
author | Holger Freyther <zecke@openmoko.org> | 2008-11-19 17:09:35 +0000 |
---|---|---|
committer | Andy Green <agreen@pads.home.warmcat.com> | 2008-11-19 17:09:35 +0000 |
commit | 5239b45897ee1d7e01176b8fd59278e194e38335 (patch) | |
tree | 340658f0fc2da13bae7cabe8830e5f0d43ea57b5 /drivers/input | |
parent | 6bef71f4feffd7cad99b14edf952f4b360c63d34 (diff) |
Simplify the code, there is no need for a branch. The code for
GTA01_GPIO_AUX_KEY looks odd.
Signed-Off-by: Holger Freyther <zecke@openmoko.org>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/keyboard/neo1973kbd.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/drivers/input/keyboard/neo1973kbd.c b/drivers/input/keyboard/neo1973kbd.c index 917d5ae1ff5..99ca9c32ccc 100644 --- a/drivers/input/keyboard/neo1973kbd.c +++ b/drivers/input/keyboard/neo1973kbd.c @@ -37,11 +37,8 @@ static irqreturn_t neo1973kbd_aux_irq(int irq, void *dev_id) struct neo1973kbd *neo1973kbd_data = dev_id; /* FIXME: use GPIO from platform_dev resources */ - if (s3c2410_gpio_getpin(GTA01_GPIO_AUX_KEY)) - input_report_key(neo1973kbd_data->input, KEY_PHONE, 0); - else - input_report_key(neo1973kbd_data->input, KEY_PHONE, 1); - + int key_pressed = !s3c2410_gpio_getpin(GTA01_GPIO_AUX_KEY); + input_report_key(neo1973kbd_data->input, KEY_PHONE, key_pressed); input_sync(neo1973kbd_data->input); return IRQ_HANDLED; @@ -52,11 +49,8 @@ static irqreturn_t neo1973kbd_hold_irq(int irq, void *dev_id) struct neo1973kbd *neo1973kbd_data = dev_id; /* FIXME: use GPIO from platform_dev resources */ - if (s3c2410_gpio_getpin(GTA01_GPIO_HOLD_KEY)) - input_report_key(neo1973kbd_data->input, KEY_PAUSE, 1); - else - input_report_key(neo1973kbd_data->input, KEY_PAUSE, 0); - + int key_pressed = 3c2410_gpio_getpin(GTA01_GPIO_HOLD_KEY); + input_report_key(neo1973kbd_data->input, KEY_PAUSE, key_pressed); input_sync(neo1973kbd_data->input); return IRQ_HANDLED; @@ -67,13 +61,9 @@ static irqreturn_t neo1973kbd_headphone_irq(int irq, void *dev_id) struct neo1973kbd *neo1973kbd_data = dev_id; /* FIXME: use GPIO from platform_dev resources */ - if (s3c2410_gpio_getpin(GTA01_GPIO_JACK_INSERT)) - input_report_switch(neo1973kbd_data->input, - SW_HEADPHONE_INSERT, 1); - else - input_report_switch(neo1973kbd_data->input, - SW_HEADPHONE_INSERT, 0); - + int key_pressed = s3c2410_gpio_getpin(GTA01_GPIO_JACK_INSERT); + input_report_switch(neo1973kbd_data->input, + SW_HEADPHONE_INSERT, key_pressed); input_sync(neo1973kbd_data->input); return IRQ_HANDLED; |