From: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
To: Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, "Uwe Kleine-König" <ukleinek@kernel.org>
Subject: [PATCH v2 06/12] misc: Use named initializers for arrays of spi_device_data
Date: Fri, 17 Jul 2026 16:50:52 +0200 [thread overview]
Message-ID: <ad1f0b3efcc3d9d362b33753734cfb064c079cd3.1784299069.git.u.kleine-koenig@baylibre.com> (raw)
In-Reply-To: <cover.1784299069.git.u.kleine-koenig@baylibre.com>
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
spi_device_id that replaces .driver_data by an anonymous union.
While touching all these arrays, unify usage of whitespace.
This patch doesn't modify the compiled arrays, only their representation
in source form benefits.
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
---
drivers/misc/ad525x_dpot-spi.c | 58 +++++++++++++++---------------
drivers/misc/gehc-achc.c | 4 +--
drivers/misc/keba/lan9252.c | 4 +--
drivers/misc/lattice-ecp3-config.c | 4 +--
4 files changed, 35 insertions(+), 35 deletions(-)
diff --git a/drivers/misc/ad525x_dpot-spi.c b/drivers/misc/ad525x_dpot-spi.c
index 263055bda48b..b582a14a3546 100644
--- a/drivers/misc/ad525x_dpot-spi.c
+++ b/drivers/misc/ad525x_dpot-spi.c
@@ -96,35 +96,35 @@ static void ad_dpot_spi_remove(struct spi_device *spi)
}
static const struct spi_device_id ad_dpot_spi_id[] = {
- {"ad5160", AD5160_ID},
- {"ad5161", AD5161_ID},
- {"ad5162", AD5162_ID},
- {"ad5165", AD5165_ID},
- {"ad5200", AD5200_ID},
- {"ad5201", AD5201_ID},
- {"ad5203", AD5203_ID},
- {"ad5204", AD5204_ID},
- {"ad5206", AD5206_ID},
- {"ad5207", AD5207_ID},
- {"ad5231", AD5231_ID},
- {"ad5232", AD5232_ID},
- {"ad5233", AD5233_ID},
- {"ad5235", AD5235_ID},
- {"ad5260", AD5260_ID},
- {"ad5262", AD5262_ID},
- {"ad5263", AD5263_ID},
- {"ad5290", AD5290_ID},
- {"ad5291", AD5291_ID},
- {"ad5292", AD5292_ID},
- {"ad5293", AD5293_ID},
- {"ad7376", AD7376_ID},
- {"ad8400", AD8400_ID},
- {"ad8402", AD8402_ID},
- {"ad8403", AD8403_ID},
- {"adn2850", ADN2850_ID},
- {"ad5270", AD5270_ID},
- {"ad5271", AD5271_ID},
- {}
+ { .name = "ad5160", .driver_data = AD5160_ID },
+ { .name = "ad5161", .driver_data = AD5161_ID },
+ { .name = "ad5162", .driver_data = AD5162_ID },
+ { .name = "ad5165", .driver_data = AD5165_ID },
+ { .name = "ad5200", .driver_data = AD5200_ID },
+ { .name = "ad5201", .driver_data = AD5201_ID },
+ { .name = "ad5203", .driver_data = AD5203_ID },
+ { .name = "ad5204", .driver_data = AD5204_ID },
+ { .name = "ad5206", .driver_data = AD5206_ID },
+ { .name = "ad5207", .driver_data = AD5207_ID },
+ { .name = "ad5231", .driver_data = AD5231_ID },
+ { .name = "ad5232", .driver_data = AD5232_ID },
+ { .name = "ad5233", .driver_data = AD5233_ID },
+ { .name = "ad5235", .driver_data = AD5235_ID },
+ { .name = "ad5260", .driver_data = AD5260_ID },
+ { .name = "ad5262", .driver_data = AD5262_ID },
+ { .name = "ad5263", .driver_data = AD5263_ID },
+ { .name = "ad5290", .driver_data = AD5290_ID },
+ { .name = "ad5291", .driver_data = AD5291_ID },
+ { .name = "ad5292", .driver_data = AD5292_ID },
+ { .name = "ad5293", .driver_data = AD5293_ID },
+ { .name = "ad7376", .driver_data = AD7376_ID },
+ { .name = "ad8400", .driver_data = AD8400_ID },
+ { .name = "ad8402", .driver_data = AD8402_ID },
+ { .name = "ad8403", .driver_data = AD8403_ID },
+ { .name = "adn2850", .driver_data = ADN2850_ID },
+ { .name = "ad5270", .driver_data = AD5270_ID },
+ { .name = "ad5271", .driver_data = AD5271_ID },
+ { }
};
MODULE_DEVICE_TABLE(spi, ad_dpot_spi_id);
diff --git a/drivers/misc/gehc-achc.c b/drivers/misc/gehc-achc.c
index 1abfa6c257de..9792189c0923 100644
--- a/drivers/misc/gehc-achc.c
+++ b/drivers/misc/gehc-achc.c
@@ -538,8 +538,8 @@ static int gehc_achc_probe(struct spi_device *spi)
}
static const struct spi_device_id gehc_achc_id[] = {
- { "ge,achc" },
- { "achc" },
+ { .name = "ge,achc" },
+ { .name = "achc" },
{ }
};
MODULE_DEVICE_TABLE(spi, gehc_achc_id);
diff --git a/drivers/misc/keba/lan9252.c b/drivers/misc/keba/lan9252.c
index fc54afd1d05b..874dd50fac66 100644
--- a/drivers/misc/keba/lan9252.c
+++ b/drivers/misc/keba/lan9252.c
@@ -339,8 +339,8 @@ static int lan9252_probe(struct spi_device *spi)
}
static const struct spi_device_id lan9252_id[] = {
- {"lan9252"},
- {}
+ { .name = "lan9252" },
+ { }
};
MODULE_DEVICE_TABLE(spi, lan9252_id);
diff --git a/drivers/misc/lattice-ecp3-config.c b/drivers/misc/lattice-ecp3-config.c
index 2b93d5660bf2..740b5cf53842 100644
--- a/drivers/misc/lattice-ecp3-config.c
+++ b/drivers/misc/lattice-ecp3-config.c
@@ -219,8 +219,8 @@ static void lattice_ecp3_remove(struct spi_device *spi)
}
static const struct spi_device_id lattice_ecp3_id[] = {
- { "ecp3-17" },
- { "ecp3-35" },
+ { .name = "ecp3-17" },
+ { .name = "ecp3-35" },
{ }
};
MODULE_DEVICE_TABLE(spi, lattice_ecp3_id);
--
2.55.0.11.g153666a7d9bb
next prev parent reply other threads:[~2026-07-17 14:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 14:50 [PATCH v2 00/12] misc: Improvements around *_device_id defintions Uwe Kleine-König (The Capable Hub)
2026-07-17 14:50 ` [PATCH v2 01/12] misc: Drop unused assignment of spi_device_id driver data Uwe Kleine-König (The Capable Hub)
2026-07-17 14:50 ` [PATCH v2 02/12] misc/pvpanic: Drop unused assignment of acpi_device_id " Uwe Kleine-König (The Capable Hub)
2026-07-17 14:50 ` [PATCH v2 03/12] misc: genwqe: Drop unused assignment of pci_device_id " Uwe Kleine-König (The Capable Hub)
2026-07-17 14:50 ` [PATCH v2 04/12] misc: eeprom: Use named initializers for arrays of i2c_device_data Uwe Kleine-König (The Capable Hub)
2026-07-17 14:50 ` [PATCH v2 05/12] misc: " Uwe Kleine-König (The Capable Hub)
2026-07-17 14:50 ` Uwe Kleine-König (The Capable Hub) [this message]
2026-07-17 15:21 ` [PATCH v2 06/12] misc: Use named initializers for arrays of spi_device_data Uwe Kleine-König (The Capable Hub)
2026-07-17 14:50 ` [PATCH v2 07/12] misc: mei: Use named initializers for acpi_device_id array Uwe Kleine-König (The Capable Hub)
2026-07-17 14:50 ` [PATCH v2 08/12] misc: mei: Use named initializer for platform_device_id array Uwe Kleine-König (The Capable Hub)
2026-07-17 14:50 ` [PATCH v2 09/12] misc: ibmvmc: Use named initializers for vio_device_id array Uwe Kleine-König (The Capable Hub)
2026-07-17 14:50 ` [PATCH v2 10/12] misc: eeprom: idt_89hpesx: Unify style of of_device_id array Uwe Kleine-König (The Capable Hub)
2026-07-17 14:50 ` [PATCH v2 11/12] misc: Unify style of of_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-07-17 14:50 ` [PATCH v2 12/12] misc: Unify code style for various *_device_id arrays Uwe Kleine-König (The Capable Hub)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ad1f0b3efcc3d9d362b33753734cfb064c079cd3.1784299069.git.u.kleine-koenig@baylibre.com \
--to=u.kleine-koenig@baylibre.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ukleinek@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox