summaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorThomas Richard <thomas.richard@bootlin.com>2024-09-24 18:13:00 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2024-10-08 22:32:43 +0200
commit2760b7c8ece34f637afebe4e1e099f6dbed362b1 (patch)
tree227ae2980357da6c74001402cf1b8249591c39f9 /package
parent15f5c7e3653da6701867668265e5603a8c08e773 (diff)
downloadopenwrt-2760b7c8ece34f637afebe4e1e099f6dbed362b1.tar.gz
openwrt-2760b7c8ece34f637afebe4e1e099f6dbed362b1.tar.bz2
openwrt-2760b7c8ece34f637afebe4e1e099f6dbed362b1.zip
gpio-button-hotplug: skip disabled buttons
Ignore buttons which are disabled in the devicetree. Reviewed-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Thomas Richard <thomas.richard@bootlin.com> Link: https://patchwork.ozlabs.org/project/openwrt/patch/mailman.117522.1727194512.1280.openwrt-devel@lists.openwrt.org/ Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'package')
-rw-r--r--package/kernel/gpio-button-hotplug/Makefile2
-rw-r--r--package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/package/kernel/gpio-button-hotplug/Makefile b/package/kernel/gpio-button-hotplug/Makefile
index 5b4085887d..caa3dce01e 100644
--- a/package/kernel/gpio-button-hotplug/Makefile
+++ b/package/kernel/gpio-button-hotplug/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk
PKG_NAME:=gpio-button-hotplug
-PKG_RELEASE:=4
+PKG_RELEASE:=5
PKG_LICENSE:=GPL-2.0
include $(INCLUDE_DIR)/package.mk
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 de100777f2..1dd0ff2a1a 100644
--- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
+++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
@@ -373,7 +373,7 @@ gpio_keys_get_devtree_pdata(struct device *dev)
if (!node)
return NULL;
- nbuttons = of_get_child_count(node);
+ nbuttons = of_get_available_child_count(node);
if (nbuttons == 0)
return ERR_PTR(-EINVAL);
@@ -388,7 +388,7 @@ gpio_keys_get_devtree_pdata(struct device *dev)
pdata->rep = !!of_get_property(node, "autorepeat", NULL);
of_property_read_u32(node, "poll-interval", &pdata->poll_interval);
- for_each_child_of_node(node, pp) {
+ for_each_available_child_of_node(node, pp) {
button = (struct gpio_keys_button *)(&pdata->buttons[i++]);
if (of_property_read_u32(pp, "linux,code", &button->code)) {