[PATCH v3 4/6] pinctrl: renesas: rzg2l: Split SoC-specific masks in struct rzg2l_register_masks

From: Diogo Ivo

Date: Fri Dec 04 2026 - 08:23:23 EST


struct rzg2l_register_masks declares the masks of the OTHER_POC register
of RZ/G3L and of the I3C_SET_POC register of RZ/G3S in two branches of an
anonymous union. As both branches share the same storage, initializing both
other_poc_pvdd1833_oth_awo_poc and i3c_set_poc on RZ/G3L would have the
designated initializers override each other, ending up with the I3C_SET_POC
value in the PVDD1833_OTH_AWO_POC mask.

Fix this by declaring all masks in a flat struct. While this technically
wastes a few bytes in SoCs that don't need all the masks it makes adding
new masks simpler, so the trade-off is worth it.

Signed-off-by: Diogo Ivo <diogo.ivo.sx@xxxxxxxxxxx>
---
Changes in v3:
- Flatten the layout to a single struct containing all masks
Changes in v2:
- No changes
---
drivers/pinctrl/renesas/pinctrl-rzg2l.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
index ca2f36c46c39..d8075671e803 100644
--- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c
+++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c
@@ -278,19 +278,10 @@ struct rzg2l_register_offsets {
* @i3c_set_poc: I3C_SET_POC mask
*/
struct rzg2l_register_masks {
- union {
- /* RZ/G3L masks */
- struct {
- u8 other_poc_pvdd1833_oth_awo_poc;
- u8 other_poc_pvdd1833_oth_iso_poc;
- u8 other_poc_wdtovf_n_poc;
- };
-
- /* RZ/G3S masks */
- struct {
- u8 i3c_set_poc;
- };
- };
+ u8 other_poc_pvdd1833_oth_awo_poc;
+ u8 other_poc_pvdd1833_oth_iso_poc;
+ u8 other_poc_wdtovf_n_poc;
+ u8 i3c_set_poc;
};

/**

--
2.56.1