[PATCH v2 4/4] x86/geode: use PROPERTY_ENTRY_REF for GPIO properties

Dmitry Torokhov posted 4 patches 3 days, 5 hours ago
[PATCH v2 4/4] x86/geode: use PROPERTY_ENTRY_REF for GPIO properties
Posted by Dmitry Torokhov 3 days, 5 hours ago
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>
---
 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 1843ae385e2d..6572ae388d7d 100644
--- a/arch/x86/platform/geode/geode-common.c
+++ b/arch/x86/platform/geode/geode-common.c
@@ -31,7 +31,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),
@@ -147,7 +147,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.53.0.1018.g2bb0e51243-goog
Re: [PATCH v2 4/4] x86/geode: use PROPERTY_ENTRY_REF for GPIO properties
Posted by Andy Shevchenko 2 days, 20 hours ago
On Sun, Mar 29, 2026 at 07:27:51PM -0700, Dmitry Torokhov wrote:
> Now that the PROPERTY_ENTRY_REF macro can accept a pointer to struct

PROPERTY_ENTRY_REF()

> software_node_ref_args directly, we don't need to use the more
> cumbersome PROPERTY_ENTRY_REF_ARRAY_LEN(..., 1) variant.

...

> int __init geode_create_leds(const char *label, const struct geode_led *leds,

>  						       leds[i].pin,
>  						       GPIO_ACTIVE_LOW);

Wondering if we want to have a wrapper for the above like

#define PROPERTY_ENTRY_GPIO_REF(...)	\
	SOFTWARE_NODE_REFERENCE(...)

(naming most likely sucks, and yeah, it would make sense if name is shorter
 than the currently used one).

>  		props[i * 3 + 0] =
> -			PROPERTY_ENTRY_REF_ARRAY_LEN("gpios", &gpio_refs[i], 1);
> +			PROPERTY_ENTRY_REF("gpios", &gpio_refs[i]);

-- 
With Best Regards,
Andy Shevchenko