diff mbox series

gpio-button-hotplug: skip disabled buttons

Message ID mailman.105761.1725546716.1280.openwrt-devel@lists.openwrt.org
State Superseded
Delegated to: Hauke Mehrtens
Headers show
Series gpio-button-hotplug: skip disabled buttons | expand

Commit Message

Thomas Richard Sept. 5, 2024, 2:26 p.m. UTC
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
Ignore buttons which are disabled in the devicetree.

Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
---
 package/kernel/gpio-button-hotplug/Makefile                  | 2 +-
 package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Rosen Penev Sept. 5, 2024, 5:53 p.m. UTC | #1
On Thu, Sep 5, 2024 at 7:33 AM Thomas Richard via openwrt-devel
<openwrt-devel@lists.openwrt.org> wrote:
>
> The sender domain has a DMARC Reject/Quarantine policy which disallows
> sending mailing list messages using the original "From" header.
>
> To mitigate this problem, the original message has been wrapped
> automatically by the mailing list software.
>
>
> ---------- Forwarded message ----------
> From: Thomas Richard <thomas.richard@bootlin.com>
> To: openwrt-devel@lists.openwrt.org
> Cc: thomas.petazzoni@bootlin.com, thomas.richard@bootlin.com
> Bcc:
> Date: Thu,  5 Sep 2024 16:26:42 +0200
> Subject: [PATCH] gpio-button-hotplug: skip disabled buttons
> Ignore buttons which are disabled in the devicetree.
>
> Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Reviewed-by: Rosen Penev <rosenp@gmail.com>
> ---
>  package/kernel/gpio-button-hotplug/Makefile                  | 2 +-
>  package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/package/kernel/gpio-button-hotplug/Makefile b/package/kernel/gpio-button-hotplug/Makefile
> index 04cbb69ada..5b4085887d 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:=3
> +PKG_RELEASE:=4
>  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 17748219e8..a73e5c4e5a 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)) {
> --
> 2.39.2
>
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
diff mbox series

Patch

diff --git a/package/kernel/gpio-button-hotplug/Makefile b/package/kernel/gpio-button-hotplug/Makefile
index 04cbb69ada..5b4085887d 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:=3
+PKG_RELEASE:=4
 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 17748219e8..a73e5c4e5a 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)) {