From 0560183f91773312aff9855997d27577e7b44729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= Date: Thu, 4 Jun 2026 18:50:28 +0200 Subject: [PATCH] w1: ds2482: Use named initializers for arrays of i2c_device_data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 i2c_device_id that replaces .driver_data by an anonymous union. This patch doesn't modify the compiled arrays, only their representation in source form benefits. The former was confirmed with x86 and arm64 builds. Signed-off-by: Uwe Kleine-König (The Capable Hub) Link: https://patch.msgid.link/20260518171456.872736-2-u.kleine-koenig@baylibre.com Signed-off-by: Krzysztof Kozlowski Link: https://patch.msgid.link/20260604165027.83922-4-krzk@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/w1/masters/ds2482.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/w1/masters/ds2482.c b/drivers/w1/masters/ds2482.c index e2a568c9a43a..0069e6f854d7 100644 --- a/drivers/w1/masters/ds2482.c +++ b/drivers/w1/masters/ds2482.c @@ -539,8 +539,8 @@ static void ds2482_remove(struct i2c_client *client) * Driver data (common to all clients) */ static const struct i2c_device_id ds2482_id[] = { - { "ds2482" }, - { "ds2484" }, + { .name = "ds2482" }, + { .name = "ds2484" }, { } }; MODULE_DEVICE_TABLE(i2c, ds2482_id);