Commit a9be2103 authored by Chandler Keep's avatar Chandler Keep Committed by Mahesh Mahadevan
Browse files

drivers/pinctrl.h: Resolve PINCTRL_DT_STATE_INIT Cpp Compatibility



This commit adds C++20 onwards support for the
PINCTRL_DT_STATE_INIT macro. Since C++20, support was
added for designated initializers but with the restriction that
they're ordered. PINCTRL_DT_STATE_INIT initializes a
pinctrl_state struct but the current initializer list is un-ordered,
this PR resolves that for >= C++20 compat

Signed-off-by: default avatarChandler Keep <chandlersamkeep@gmail.com>
parent 7aef84ce
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -414,9 +414,9 @@ static inline int pinctrl_apply_state(const struct pinctrl_dev_config *config,
 */
#define PINCTRL_DT_STATE_INIT(prop, state)				       \
	{								       \
		.id = state,						       \
		.pins = prop ## _pins,					       \
		.pin_cnt = ARRAY_SIZE(prop ## _pins)			       \
		.pin_cnt = ARRAY_SIZE(prop ## _pins),			       \
		.id = state						       \
	}

/**