[OpenWrt-Devel] [PATCH] gpio-button-hotplug: gpio-keys: fix always missing first event

Petr Štetiar ynezz at true.cz
Tue Jun 4 09:05:41 EDT 2019


Commit afc056d7dc83 ("gpio-button-hotplug: support interrupt
properties") changed the gpio-keys interrupt handling logic in a way,
that it always misses first event, which causes issues with rc.button
scripts, so this patch restores the previous behaviour.

Cc: Christian Lamparter <chunkeey at gmail.com>
Fixes: afc056d7dc83 ("gpio-button-hotplug: support interrupt properties")
Reported-by: Kristian Evensen <kristian.evensen at gmail.com>
Signed-off-by: Petr Štetiar <ynezz at true.cz>
---
 package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
index f429f8c0271f..81697e9c4cf6 100644
--- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
+++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
@@ -344,10 +344,7 @@ static void gpio_keys_irq_work_func(struct work_struct *work)
 
 	if (state != bdata->last_state) {
 		unsigned int type = bdata->b->type ?: EV_KEY;
-
-		if (bdata->last_state != -1 || type == EV_SW)
-			button_hotplug_event(bdata, type, state);
-
+		button_hotplug_event(bdata, type, state);
 		bdata->last_state = state;
 	}
 }
-- 
1.9.1


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list