gpio-button-hotplug: use gpio_button_get_value() to fetch state.
authorJohn Crispin <john@openwrt.org>
Thu, 1 Aug 2013 14:31:24 +0000 (14:31 +0000)
committerJohn Crispin <john@openwrt.org>
Thu, 1 Aug 2013 14:31:24 +0000 (14:31 +0000)
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
SVN-Revision: 37642

package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c

index 7fe169067d47b282248f4cf6a90d7ddb5479cbde..9cbee21e0a5e70f62ee6b29f6099ead63cd7a5ca 100644 (file)
@@ -288,10 +288,7 @@ static void gpio_keys_polled_check_state(struct gpio_keys_button *button,
 {
        int state;
 
 {
        int state;
 
-       if (bdata->can_sleep)
-               state = !!gpio_get_value_cansleep(button->gpio);
-       else
-               state = !!gpio_get_value(button->gpio);
+       state = gpio_button_get_value(button, bdata);
 
        state = !!(state ^ button->active_low);
        if (state != bdata->last_state) {
 
        state = !!(state ^ button->active_low);
        if (state != bdata->last_state) {