Bug in keyboard driver

Diego Fdez. Durán diego at goedi.net
Thu May 8 10:00:57 CEST 2008


On Thu, May 8, 2008 09:08, Sean McNeil wrote:
> the KEY_PHONE is backwards. It returns up when pushed and down when
> released. The following change fixes it:
>
>  static irqreturn_t neo1973kbd_aux_irq(int irq, void *dev_id)
>  {
>         struct neo1973kbd *neo1973kbd_data = dev_id;
>
> -       int key_pressed = !gpio_get_value(irq_to_gpio(irq));
> +       int key_pressed = !!gpio_get_value(irq_to_gpio(irq));

Pardon my ignorance, but... double negative? It wouldn't be better:

          int key_pressed = gpio_get_value(irq_to_gpio(irq));

?

>         input_report_key(neo1973kbd_data->input, KEY_PHONE, key_pressed);
>         input_sync(neo1973kbd_data->input);
>
>
>


-- 
Diego Fdez. Durán <diego at goedi.net> | http://www.goedi.net
GPG : 925C 9A21 7A11 3B13 6E43 50DB F579 D119 90D2 66BB





More information about the openmoko-kernel mailing list