[PATCH v4 13/23] gpio: Use named initializers for auxiliary_device_id arrays

From: Uwe Kleine-König (The Capable Hub)

Date: Tue Oct 27 2026 - 07:04:00 EST


While being less compact, using named initializers allows to more easily
see which members of the structs are assigned which value without having
to lookup the declaration of the struct. And it's also more robust
against changes to the struct definition.

The mentioned robustness is relevant for a planned change to struct
auxiliary_device_id that replaces .driver_data by an anonymous union
(though none of these drivers uses .driver_data, so this patch isn't
strictly necessary for the plan, but still ok for consistency).

This patch doesn't modify the compiled arrays, only their representation
in source form benefits.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@xxxxxxxxxxxx>
---
drivers/gpio/gpio-elkhartlake.c | 2 +-
drivers/gpio/gpio-ljca.c | 2 +-
drivers/gpio/gpio-ltc4283.c | 2 +-
drivers/gpio/gpio-tc9563.c | 2 +-
drivers/gpio/gpio-usbio.c | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpio/gpio-elkhartlake.c b/drivers/gpio/gpio-elkhartlake.c
index b96e7928b6e5..d4ddb3d00b86 100644
--- a/drivers/gpio/gpio-elkhartlake.c
+++ b/drivers/gpio/gpio-elkhartlake.c
@@ -59,7 +59,7 @@ static int ehl_gpio_probe(struct auxiliary_device *adev, const struct auxiliary_
}

static const struct auxiliary_device_id ehl_gpio_ids[] = {
- { EHL_PSE_IO_NAME "." EHL_PSE_GPIO_NAME },
+ { .name = EHL_PSE_IO_NAME "." EHL_PSE_GPIO_NAME },
{ }
};
MODULE_DEVICE_TABLE(auxiliary, ehl_gpio_ids);
diff --git a/drivers/gpio/gpio-ljca.c b/drivers/gpio/gpio-ljca.c
index ad5dc9a3a119..f967feedb5d2 100644
--- a/drivers/gpio/gpio-ljca.c
+++ b/drivers/gpio/gpio-ljca.c
@@ -472,7 +472,7 @@ static void ljca_gpio_remove(struct auxiliary_device *auxdev)
}

static const struct auxiliary_device_id ljca_gpio_id_table[] = {
- { "usb_ljca.ljca-gpio" },
+ { .name = "usb_ljca.ljca-gpio" },
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(auxiliary, ljca_gpio_id_table);
diff --git a/drivers/gpio/gpio-ltc4283.c b/drivers/gpio/gpio-ltc4283.c
index 88aa6216006a..3295f159d83f 100644
--- a/drivers/gpio/gpio-ltc4283.c
+++ b/drivers/gpio/gpio-ltc4283.c
@@ -201,7 +201,7 @@ static int ltc4283_gpio_probe(struct auxiliary_device *adev,
}

static const struct auxiliary_device_id ltc4283_aux_id_table[] = {
- { "ltc4283.gpio" },
+ { .name = "ltc4283.gpio" },
{ }
};
MODULE_DEVICE_TABLE(auxiliary, ltc4283_aux_id_table);
diff --git a/drivers/gpio/gpio-tc9563.c b/drivers/gpio/gpio-tc9563.c
index 68c20c8cba79..5ba9df2b6936 100644
--- a/drivers/gpio/gpio-tc9563.c
+++ b/drivers/gpio/gpio-tc9563.c
@@ -80,7 +80,7 @@ static int tc9563_gpio_probe(struct auxiliary_device *adev,
};

static const struct auxiliary_device_id tc9563_gpio_ids[] = {
- { "pci_pwrctrl_tc9563." TC9563_GPIO_DEV_NAME },
+ { .name = "pci_pwrctrl_tc9563." TC9563_GPIO_DEV_NAME },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(auxiliary, tc9563_gpio_ids);
diff --git a/drivers/gpio/gpio-usbio.c b/drivers/gpio/gpio-usbio.c
index e34734aa4365..fe8f51f1a4b1 100644
--- a/drivers/gpio/gpio-usbio.c
+++ b/drivers/gpio/gpio-usbio.c
@@ -230,7 +230,7 @@ static int usbio_gpio_probe(struct auxiliary_device *adev,
}

static const struct auxiliary_device_id usbio_gpio_id_table[] = {
- { "usbio.usbio-gpio" },
+ { .name = "usbio.usbio-gpio" },
{ }
};
MODULE_DEVICE_TABLE(auxiliary, usbio_gpio_id_table);
--
2.56.0.rc1