x86/geode: use PROPERTY_ENTRY_REF for GPIO properties
Subsystems (2)
PATCH 1/1 x86/geode: use PROPERTY_ENTRY_REF for GPIO properties
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.
---
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/[email protected]/
arch/x86/platform/geode/geode-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/platform/geode/geode-common.c +2 -2
@@ -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 ?
Signature · 5 lines
2.55.0.1082.g2b9226bbc0-goog -- Dmitry