mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/geode: use PROPERTY_ENTRY_REF for GPIO properties
@ 2026-09-21  2:21 Dmitry Torokhov
  0 siblings, 0 replies; only message in thread
From: Dmitry Torokhov @ 2026-09-21  2:21 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen
  Cc: x86, H. Peter Anvin, Bartosz Golaszewski, linux-geode, linux-kernel

Now that the PROPERTY_ENTRY_REF macro can accept a pointer to struct
software_node_ref_args directly, we don't need to use the more
cumbersome PROPERTY_ENTRY_REF_ARRAY_LEN(..., 1) variant.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---

This patch was originally posted as patch 4/4 of the "Fix handling of
GPIO keys and LEDs on geode" series [1].

From that series:
- Patch 1/4 was applied to tip:x86/urgent as commit b981e9e94c68
  ("x86/platform/geode: Fix on-stack property data use-after-return
  bug").
- Patch 2/4 was merged through the driver-core tree as commit
  fe221742e388 ("software node: allow passing reference args to
  PROPERTY_ENTRY_REF()").
- Patch 3/4 (stack check in software_node_register()) has been dropped
  due to limitations of object_is_on_stack() with CONFIG_VMAP_STACK.

Now that commit fe221742e388 is in mainline, resending patch 4/4 as a
standalone cleanup rebased onto current upstream.

[1] https://lore.kernel.org/all/20260329-property-gpio-fix-v2-4-3cca5ba136d8@gmail.com/

 arch/x86/platform/geode/geode-common.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/platform/geode/geode-common.c b/arch/x86/platform/geode/geode-common.c
index 679b4b07b790..e1c434499824 100644
--- a/arch/x86/platform/geode/geode-common.c
+++ b/arch/x86/platform/geode/geode-common.c
@@ -28,7 +28,7 @@ static const struct software_node geode_gpio_keys_node = {
 static struct software_node_ref_args geode_restart_gpio_ref;
 
 static const struct property_entry geode_restart_key_props[] = {
-	PROPERTY_ENTRY_REF_ARRAY_LEN("gpios", &geode_restart_gpio_ref, 1),
+	PROPERTY_ENTRY_REF("gpios", &geode_restart_gpio_ref),
 	PROPERTY_ENTRY_U32("linux,code", KEY_RESTART),
 	PROPERTY_ENTRY_STRING("label", "Reset button"),
 	PROPERTY_ENTRY_U32("debounce-interval", 100),
@@ -143,7 +143,7 @@ int __init geode_create_leds(const char *label, const struct geode_led *leds,
 						       leds[i].pin,
 						       GPIO_ACTIVE_LOW);
 		props[i * 3 + 0] =
-			PROPERTY_ENTRY_REF_ARRAY_LEN("gpios", &gpio_refs[i], 1);
+			PROPERTY_ENTRY_REF("gpios", &gpio_refs[i]);
 		props[i * 3 + 1] =
 			PROPERTY_ENTRY_STRING("linux,default-trigger",
 					      leds[i].default_on ?
-- 
2.55.0.1082.g2b9226bbc0-goog


-- 
Dmitry

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-21  2:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-21  2:21 [PATCH] x86/geode: use PROPERTY_ENTRY_REF for GPIO properties Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®