summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>2026-07-17 16:50:51 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-07-31 14:20:50 +0200
commita4fa3300f02e2c47ccd3ff95b364256782576320 (patch)
tree854b524bcadc1a83544d552faeb5b45ee6cb0e75
parent230cb31dc3cb8163772fe7c47440227d5285f1e4 (diff)
downloadlinux-next-a4fa3300f02e2c47ccd3ff95b364256782576320.tar.gz
linux-next-a4fa3300f02e2c47ccd3ff95b364256782576320.zip
misc: Use named initializers for arrays of i2c_device_data
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. 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 (The Capable Hub) <u.kleine-koenig@baylibre.com> Link: https://patch.msgid.link/5a4fb64166ab7e06adf94e5fa3d46bb5f6493324.1784299069.git.u.kleine-koenig@baylibre.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/misc/ad525x_dpot-i2c.c52
-rw-r--r--drivers/misc/amd-sbi/rmi-i2c.c4
-rw-r--r--drivers/misc/apds9802als.c2
-rw-r--r--drivers/misc/bh1770glc.c6
-rw-r--r--drivers/misc/ds1682.c2
-rw-r--r--drivers/misc/hmc6352.c2
-rw-r--r--drivers/misc/ics932s401.c2
-rw-r--r--drivers/misc/isl29003.c4
-rw-r--r--drivers/misc/isl29020.c2
-rw-r--r--drivers/misc/lis3lv02d/lis3lv02d_i2c.c6
-rw-r--r--drivers/misc/tsl2550.c2
11 files changed, 42 insertions, 42 deletions
diff --git a/drivers/misc/ad525x_dpot-i2c.c b/drivers/misc/ad525x_dpot-i2c.c
index 896ad61bb9e1..a74b0266ea16 100644
--- a/drivers/misc/ad525x_dpot-i2c.c
+++ b/drivers/misc/ad525x_dpot-i2c.c
@@ -73,32 +73,32 @@ static void ad_dpot_i2c_remove(struct i2c_client *client)
}
static const struct i2c_device_id ad_dpot_id[] = {
- {"ad5258", AD5258_ID},
- {"ad5259", AD5259_ID},
- {"ad5251", AD5251_ID},
- {"ad5252", AD5252_ID},
- {"ad5253", AD5253_ID},
- {"ad5254", AD5254_ID},
- {"ad5255", AD5255_ID},
- {"ad5241", AD5241_ID},
- {"ad5242", AD5242_ID},
- {"ad5243", AD5243_ID},
- {"ad5245", AD5245_ID},
- {"ad5246", AD5246_ID},
- {"ad5247", AD5247_ID},
- {"ad5248", AD5248_ID},
- {"ad5280", AD5280_ID},
- {"ad5282", AD5282_ID},
- {"adn2860", ADN2860_ID},
- {"ad5273", AD5273_ID},
- {"ad5161", AD5161_ID},
- {"ad5171", AD5171_ID},
- {"ad5170", AD5170_ID},
- {"ad5172", AD5172_ID},
- {"ad5173", AD5173_ID},
- {"ad5272", AD5272_ID},
- {"ad5274", AD5274_ID},
- {}
+ { .name = "ad5258", .driver_data = AD5258_ID },
+ { .name = "ad5259", .driver_data = AD5259_ID },
+ { .name = "ad5251", .driver_data = AD5251_ID },
+ { .name = "ad5252", .driver_data = AD5252_ID },
+ { .name = "ad5253", .driver_data = AD5253_ID },
+ { .name = "ad5254", .driver_data = AD5254_ID },
+ { .name = "ad5255", .driver_data = AD5255_ID },
+ { .name = "ad5241", .driver_data = AD5241_ID },
+ { .name = "ad5242", .driver_data = AD5242_ID },
+ { .name = "ad5243", .driver_data = AD5243_ID },
+ { .name = "ad5245", .driver_data = AD5245_ID },
+ { .name = "ad5246", .driver_data = AD5246_ID },
+ { .name = "ad5247", .driver_data = AD5247_ID },
+ { .name = "ad5248", .driver_data = AD5248_ID },
+ { .name = "ad5280", .driver_data = AD5280_ID },
+ { .name = "ad5282", .driver_data = AD5282_ID },
+ { .name = "adn2860", .driver_data = ADN2860_ID },
+ { .name = "ad5273", .driver_data = AD5273_ID },
+ { .name = "ad5161", .driver_data = AD5161_ID },
+ { .name = "ad5171", .driver_data = AD5171_ID },
+ { .name = "ad5170", .driver_data = AD5170_ID },
+ { .name = "ad5172", .driver_data = AD5172_ID },
+ { .name = "ad5173", .driver_data = AD5173_ID },
+ { .name = "ad5272", .driver_data = AD5272_ID },
+ { .name = "ad5274", .driver_data = AD5274_ID },
+ { }
};
MODULE_DEVICE_TABLE(i2c, ad_dpot_id);
diff --git a/drivers/misc/amd-sbi/rmi-i2c.c b/drivers/misc/amd-sbi/rmi-i2c.c
index 37e5ea83bf97..bbc0d14d1cfc 100644
--- a/drivers/misc/amd-sbi/rmi-i2c.c
+++ b/drivers/misc/amd-sbi/rmi-i2c.c
@@ -141,8 +141,8 @@ static void sbrmi_i2c_remove(struct i2c_client *client)
}
static const struct i2c_device_id sbrmi_id[] = {
- {"sbrmi-i2c"},
- {}
+ { .name = "sbrmi-i2c" },
+ { }
};
MODULE_DEVICE_TABLE(i2c, sbrmi_id);
diff --git a/drivers/misc/apds9802als.c b/drivers/misc/apds9802als.c
index fc504bd8d916..1488e28819b7 100644
--- a/drivers/misc/apds9802als.c
+++ b/drivers/misc/apds9802als.c
@@ -285,7 +285,7 @@ static UNIVERSAL_DEV_PM_OPS(apds9802als_pm_ops, apds9802als_suspend,
#endif /* CONFIG_PM */
static const struct i2c_device_id apds9802als_id[] = {
- { DRIVER_NAME },
+ { .name = DRIVER_NAME },
{ }
};
diff --git a/drivers/misc/bh1770glc.c b/drivers/misc/bh1770glc.c
index 45f8fc69a711..98fc5970b2bb 100644
--- a/drivers/misc/bh1770glc.c
+++ b/drivers/misc/bh1770glc.c
@@ -1363,9 +1363,9 @@ static int bh1770_runtime_resume(struct device *dev)
#endif
static const struct i2c_device_id bh1770_id[] = {
- { "bh1770glc" },
- { "sfh7770" },
- {}
+ { .name = "bh1770glc" },
+ { .name = "sfh7770" },
+ { }
};
MODULE_DEVICE_TABLE(i2c, bh1770_id);
diff --git a/drivers/misc/ds1682.c b/drivers/misc/ds1682.c
index cb09e056531a..f073a5067fc8 100644
--- a/drivers/misc/ds1682.c
+++ b/drivers/misc/ds1682.c
@@ -271,7 +271,7 @@ static void ds1682_remove(struct i2c_client *client)
}
static const struct i2c_device_id ds1682_id[] = {
- { "ds1682" },
+ { .name = "ds1682" },
{ }
};
MODULE_DEVICE_TABLE(i2c, ds1682_id);
diff --git a/drivers/misc/hmc6352.c b/drivers/misc/hmc6352.c
index ff92c6edff6b..275dc054ca04 100644
--- a/drivers/misc/hmc6352.c
+++ b/drivers/misc/hmc6352.c
@@ -121,7 +121,7 @@ static void hmc6352_remove(struct i2c_client *client)
}
static const struct i2c_device_id hmc6352_id[] = {
- { "hmc6352" },
+ { .name = "hmc6352" },
{ }
};
diff --git a/drivers/misc/ics932s401.c b/drivers/misc/ics932s401.c
index 015710762a65..e8bcf0df2da8 100644
--- a/drivers/misc/ics932s401.c
+++ b/drivers/misc/ics932s401.c
@@ -95,7 +95,7 @@ static int ics932s401_detect(struct i2c_client *client,
static void ics932s401_remove(struct i2c_client *client);
static const struct i2c_device_id ics932s401_id[] = {
- { "ics932s401" },
+ { .name = "ics932s401" },
{ }
};
MODULE_DEVICE_TABLE(i2c, ics932s401_id);
diff --git a/drivers/misc/isl29003.c b/drivers/misc/isl29003.c
index 95480e16ae5f..c9b526a212d0 100644
--- a/drivers/misc/isl29003.c
+++ b/drivers/misc/isl29003.c
@@ -449,8 +449,8 @@ static SIMPLE_DEV_PM_OPS(isl29003_pm_ops, isl29003_suspend, isl29003_resume);
#endif /* CONFIG_PM_SLEEP */
static const struct i2c_device_id isl29003_id[] = {
- { "isl29003" },
- {}
+ { .name = "isl29003" },
+ { }
};
MODULE_DEVICE_TABLE(i2c, isl29003_id);
diff --git a/drivers/misc/isl29020.c b/drivers/misc/isl29020.c
index c288aeec16c0..dd966db28ec4 100644
--- a/drivers/misc/isl29020.c
+++ b/drivers/misc/isl29020.c
@@ -177,7 +177,7 @@ static void isl29020_remove(struct i2c_client *client)
}
static const struct i2c_device_id isl29020_id[] = {
- { "isl29020" },
+ { .name = "isl29020" },
{ }
};
diff --git a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
index 15119584473c..36032fc125f3 100644
--- a/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
+++ b/drivers/misc/lis3lv02d/lis3lv02d_i2c.c
@@ -247,9 +247,9 @@ static int lis3_i2c_runtime_resume(struct device *dev)
#endif /* CONFIG_PM */
static const struct i2c_device_id lis3lv02d_id[] = {
- {"lis3lv02d", LIS3LV02D},
- {"lis331dlh", LIS331DLH},
- {}
+ { .name = "lis3lv02d", .driver_data = LIS3LV02D },
+ { .name = "lis331dlh", .driver_data = LIS331DLH },
+ { }
};
MODULE_DEVICE_TABLE(i2c, lis3lv02d_id);
diff --git a/drivers/misc/tsl2550.c b/drivers/misc/tsl2550.c
index 03f19eda641e..c871ea860bb5 100644
--- a/drivers/misc/tsl2550.c
+++ b/drivers/misc/tsl2550.c
@@ -420,7 +420,7 @@ static SIMPLE_DEV_PM_OPS(tsl2550_pm_ops, tsl2550_suspend, tsl2550_resume);
#endif /* CONFIG_PM_SLEEP */
static const struct i2c_device_id tsl2550_id[] = {
- { "tsl2550" },
+ { .name = "tsl2550" },
{ }
};
MODULE_DEVICE_TABLE(i2c, tsl2550_id);