Diego Fdez. Durán wrote:
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));

?
I was uncertain what the value is that gets returned. If it is 0 or 1, then yes it would be better to not do a !!. If it returns other than 0 or 1 then it needs to be modified.


Reply via email to