rtc: 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 and commas.

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) <u.kleine-koenig@baylibre.com>
Reviewed-by: Tóth János <gomba007@gmail.com>
Link: https://patch.msgid.link/20260515154720.406128-2-u.kleine-koenig@baylibre.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
Uwe Kleine-König (The Capable Hub)
2026-06-22 02:20:13 +02:00
committed by Alexandre Belloni
parent a091e1ba3b
commit 3eebec1cb5
34 changed files with 97 additions and 97 deletions
+1 -1
View File
@@ -933,7 +933,7 @@ MODULE_DEVICE_TABLE(of, abb5zes3_dt_match);
#endif
static const struct i2c_device_id abb5zes3_id[] = {
{ "abb5zes3" },
{ .name = "abb5zes3" },
{ }
};
MODULE_DEVICE_TABLE(i2c, abb5zes3_id);
+1 -1
View File
@@ -546,7 +546,7 @@ MODULE_DEVICE_TABLE(of, abeoz9_dt_match);
#endif
static const struct i2c_device_id abeoz9_id[] = {
{ "abeoz9" },
{ .name = "abeoz9" },
{ }
};
+10 -10
View File
@@ -753,16 +753,16 @@ static int abx80x_setup_nvmem(struct abx80x_priv *priv)
}
static const struct i2c_device_id abx80x_id[] = {
{ "abx80x", ABX80X },
{ "ab0801", AB0801 },
{ "ab0803", AB0803 },
{ "ab0804", AB0804 },
{ "ab0805", AB0805 },
{ "ab1801", AB1801 },
{ "ab1803", AB1803 },
{ "ab1804", AB1804 },
{ "ab1805", AB1805 },
{ "rv1805", RV1805 },
{ .name = "abx80x", .driver_data = ABX80X },
{ .name = "ab0801", .driver_data = AB0801 },
{ .name = "ab0803", .driver_data = AB0803 },
{ .name = "ab0804", .driver_data = AB0804 },
{ .name = "ab0805", .driver_data = AB0805 },
{ .name = "ab1801", .driver_data = AB1801 },
{ .name = "ab1803", .driver_data = AB1803 },
{ .name = "ab1804", .driver_data = AB1804 },
{ .name = "ab1805", .driver_data = AB1805 },
{ .name = "rv1805", .driver_data = RV1805 },
{ }
};
MODULE_DEVICE_TABLE(i2c, abx80x_id);
+1 -1
View File
@@ -304,7 +304,7 @@ static void bq32k_remove(struct i2c_client *client)
}
static const struct i2c_device_id bq32k_id[] = {
{ "bq32000" },
{ .name = "bq32000" },
{ }
};
MODULE_DEVICE_TABLE(i2c, bq32k_id);
+18 -18
View File
@@ -1069,24 +1069,24 @@ static const struct chip_desc chips[last_ds_type] = {
};
static const struct i2c_device_id ds1307_id[] = {
{ "ds1307", ds_1307 },
{ "ds1308", ds_1308 },
{ "ds1337", ds_1337 },
{ "ds1338", ds_1338 },
{ "ds1339", ds_1339 },
{ "ds1388", ds_1388 },
{ "ds1340", ds_1340 },
{ "ds1341", ds_1341 },
{ "ds3231", ds_3231 },
{ "m41t0", m41t0 },
{ "m41t00", m41t00 },
{ "m41t11", m41t11 },
{ "mcp7940x", mcp794xx },
{ "mcp7941x", mcp794xx },
{ "pt7c4338", ds_1307 },
{ "rx8025", rx_8025 },
{ "isl12057", ds_1337 },
{ "rx8130", rx_8130 },
{ .name = "ds1307", .driver_data = ds_1307 },
{ .name = "ds1308", .driver_data = ds_1308 },
{ .name = "ds1337", .driver_data = ds_1337 },
{ .name = "ds1338", .driver_data = ds_1338 },
{ .name = "ds1339", .driver_data = ds_1339 },
{ .name = "ds1388", .driver_data = ds_1388 },
{ .name = "ds1340", .driver_data = ds_1340 },
{ .name = "ds1341", .driver_data = ds_1341 },
{ .name = "ds3231", .driver_data = ds_3231 },
{ .name = "m41t0", .driver_data = m41t0 },
{ .name = "m41t00", .driver_data = m41t00 },
{ .name = "m41t11", .driver_data = m41t11 },
{ .name = "mcp7940x", .driver_data = mcp794xx },
{ .name = "mcp7941x", .driver_data = mcp794xx },
{ .name = "pt7c4338", .driver_data = ds_1307 },
{ .name = "rx8025", .driver_data = rx_8025 },
{ .name = "isl12057", .driver_data = ds_1337 },
{ .name = "rx8130", .driver_data = rx_8130 },
{ }
};
MODULE_DEVICE_TABLE(i2c, ds1307_id);
+1 -1
View File
@@ -52,7 +52,7 @@
#define DS1374_REG_TCR 0x09 /* Trickle Charge */
static const struct i2c_device_id ds1374_id[] = {
{ "ds1374" },
{ .name = "ds1374" },
{ }
};
MODULE_DEVICE_TABLE(i2c, ds1374_id);
+1 -1
View File
@@ -133,7 +133,7 @@ static int ds1672_probe(struct i2c_client *client)
}
static const struct i2c_device_id ds1672_id[] = {
{ "ds1672" },
{ .name = "ds1672" },
{ }
};
MODULE_DEVICE_TABLE(i2c, ds1672_id);
+1 -1
View File
@@ -566,7 +566,7 @@ static int ds3232_i2c_probe(struct i2c_client *client)
}
static const struct i2c_device_id ds3232_id[] = {
{ "ds3232" },
{ .name = "ds3232" },
{ }
};
MODULE_DEVICE_TABLE(i2c, ds3232_id);
+1 -1
View File
@@ -129,7 +129,7 @@ static int em3027_probe(struct i2c_client *client)
}
static const struct i2c_device_id em3027_id[] = {
{ "em3027" },
{ .name = "em3027" },
{ }
};
MODULE_DEVICE_TABLE(i2c, em3027_id);
+1 -1
View File
@@ -53,7 +53,7 @@ struct fm3130 {
int data_valid;
};
static const struct i2c_device_id fm3130_id[] = {
{ "fm3130" },
{ .name = "fm3130" },
{ }
};
MODULE_DEVICE_TABLE(i2c, fm3130_id);
+2 -2
View File
@@ -564,8 +564,8 @@ static int hym8563_probe(struct i2c_client *client)
}
static const struct i2c_device_id hym8563_id[] = {
{ "hym8563" },
{}
{ .name = "hym8563" },
{ }
};
MODULE_DEVICE_TABLE(i2c, hym8563_id);
+1 -1
View File
@@ -604,7 +604,7 @@ static const struct of_device_id isl12022_dt_match[] = {
MODULE_DEVICE_TABLE(of, isl12022_dt_match);
static const struct i2c_device_id isl12022_id[] = {
{ "isl12022" },
{ .name = "isl12022" },
{ }
};
MODULE_DEVICE_TABLE(i2c, isl12022_id);
+2 -2
View File
@@ -485,8 +485,8 @@ static const struct of_device_id isl12026_dt_match[] = {
MODULE_DEVICE_TABLE(of, isl12026_dt_match);
static const struct i2c_device_id isl12026_id[] = {
{ "isl12026" },
{ },
{ .name = "isl12026" },
{ }
};
MODULE_DEVICE_TABLE(i2c, isl12026_id);
+5 -5
View File
@@ -110,11 +110,11 @@ static const struct isl1208_config config_raa215300_a0 = {
};
static const struct i2c_device_id isl1208_id[] = {
{ "isl1208", .driver_data = (kernel_ulong_t)&config_isl1208 },
{ "isl1209", .driver_data = (kernel_ulong_t)&config_isl1209 },
{ "isl1218", .driver_data = (kernel_ulong_t)&config_isl1218 },
{ "isl1219", .driver_data = (kernel_ulong_t)&config_isl1219 },
{ "raa215300_a0", .driver_data = (kernel_ulong_t)&config_raa215300_a0 },
{ .name = "isl1208", .driver_data = (kernel_ulong_t)&config_isl1208 },
{ .name = "isl1209", .driver_data = (kernel_ulong_t)&config_isl1209 },
{ .name = "isl1218", .driver_data = (kernel_ulong_t)&config_isl1218 },
{ .name = "isl1219", .driver_data = (kernel_ulong_t)&config_isl1219 },
{ .name = "raa215300_a0", .driver_data = (kernel_ulong_t)&config_raa215300_a0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, isl1208_id);
+11 -11
View File
@@ -71,17 +71,17 @@
#define M41T80_FEATURE_SQ_ALT BIT(4) /* RSx bits are in reg 4 */
static const struct i2c_device_id m41t80_id[] = {
{ "m41t62", M41T80_FEATURE_SQ | M41T80_FEATURE_SQ_ALT },
{ "m41t65", M41T80_FEATURE_WD },
{ "m41t80", M41T80_FEATURE_SQ },
{ "m41t81", M41T80_FEATURE_HT | M41T80_FEATURE_SQ},
{ "m41t81s", M41T80_FEATURE_HT | M41T80_FEATURE_BL | M41T80_FEATURE_SQ },
{ "m41t82", M41T80_FEATURE_HT | M41T80_FEATURE_BL | M41T80_FEATURE_SQ },
{ "m41t83", M41T80_FEATURE_HT | M41T80_FEATURE_BL | M41T80_FEATURE_SQ },
{ "m41st84", M41T80_FEATURE_HT | M41T80_FEATURE_BL | M41T80_FEATURE_SQ },
{ "m41st85", M41T80_FEATURE_HT | M41T80_FEATURE_BL | M41T80_FEATURE_SQ },
{ "m41st87", M41T80_FEATURE_HT | M41T80_FEATURE_BL | M41T80_FEATURE_SQ },
{ "rv4162", M41T80_FEATURE_SQ | M41T80_FEATURE_WD | M41T80_FEATURE_SQ_ALT },
{ .name = "m41t62", .driver_data = M41T80_FEATURE_SQ | M41T80_FEATURE_SQ_ALT },
{ .name = "m41t65", .driver_data = M41T80_FEATURE_WD },
{ .name = "m41t80", .driver_data = M41T80_FEATURE_SQ },
{ .name = "m41t81", .driver_data = M41T80_FEATURE_HT | M41T80_FEATURE_SQ},
{ .name = "m41t81s", .driver_data = M41T80_FEATURE_HT | M41T80_FEATURE_BL | M41T80_FEATURE_SQ },
{ .name = "m41t82", .driver_data = M41T80_FEATURE_HT | M41T80_FEATURE_BL | M41T80_FEATURE_SQ },
{ .name = "m41t83", .driver_data = M41T80_FEATURE_HT | M41T80_FEATURE_BL | M41T80_FEATURE_SQ },
{ .name = "m41st84", .driver_data = M41T80_FEATURE_HT | M41T80_FEATURE_BL | M41T80_FEATURE_SQ },
{ .name = "m41st85", .driver_data = M41T80_FEATURE_HT | M41T80_FEATURE_BL | M41T80_FEATURE_SQ },
{ .name = "m41st87", .driver_data = M41T80_FEATURE_HT | M41T80_FEATURE_BL | M41T80_FEATURE_SQ },
{ .name = "rv4162", .driver_data = M41T80_FEATURE_SQ | M41T80_FEATURE_WD | M41T80_FEATURE_SQ_ALT },
{ }
};
MODULE_DEVICE_TABLE(i2c, m41t80_id);
+2 -2
View File
@@ -745,8 +745,8 @@ static int max31335_probe(struct i2c_client *client)
}
static const struct i2c_device_id max31335_id[] = {
{ "max31331", (kernel_ulong_t)&chip[ID_MAX31331] },
{ "max31335", (kernel_ulong_t)&chip[ID_MAX31335] },
{ .name = "max31331", .driver_data = (kernel_ulong_t)&chip[ID_MAX31331] },
{ .name = "max31335", .driver_data = (kernel_ulong_t)&chip[ID_MAX31335] },
{ }
};
+1 -1
View File
@@ -215,7 +215,7 @@ static int max6900_probe(struct i2c_client *client)
}
static const struct i2c_device_id max6900_id[] = {
{ "max6900" },
{ .name = "max6900" },
{ }
};
MODULE_DEVICE_TABLE(i2c, max6900_id);
+1 -1
View File
@@ -572,7 +572,7 @@ static int nct3018y_probe(struct i2c_client *client)
}
static const struct i2c_device_id nct3018y_id[] = {
{ "nct3018y" },
{ .name = "nct3018y" },
{ }
};
MODULE_DEVICE_TABLE(i2c, nct3018y_id);
+4 -4
View File
@@ -1449,10 +1449,10 @@ static const struct regmap_bus pcf2127_i2c_regmap = {
static struct i2c_driver pcf2127_i2c_driver;
static const struct i2c_device_id pcf2127_i2c_id[] = {
{ "pcf2127", (kernel_ulong_t)&pcf21xx_cfg[PCF2127] },
{ "pcf2129", (kernel_ulong_t)&pcf21xx_cfg[PCF2129] },
{ "pca2129", (kernel_ulong_t)&pcf21xx_cfg[PCF2129] },
{ "pcf2131", (kernel_ulong_t)&pcf21xx_cfg[PCF2131] },
{ .name = "pcf2127", .driver_data = (kernel_ulong_t)&pcf21xx_cfg[PCF2127] },
{ .name = "pcf2129", .driver_data = (kernel_ulong_t)&pcf21xx_cfg[PCF2129] },
{ .name = "pca2129", .driver_data = (kernel_ulong_t)&pcf21xx_cfg[PCF2129] },
{ .name = "pcf2131", .driver_data = (kernel_ulong_t)&pcf21xx_cfg[PCF2131] },
{ }
};
MODULE_DEVICE_TABLE(i2c, pcf2127_i2c_id);
+6 -6
View File
@@ -665,12 +665,12 @@ static const struct pcf85063_config config_rv8263 = {
};
static const struct i2c_device_id pcf85063_ids[] = {
{ "pca85073a", .driver_data = (kernel_ulong_t)&config_pcf85063a },
{ "pcf85063", .driver_data = (kernel_ulong_t)&config_pcf85063 },
{ "pcf85063tp", .driver_data = (kernel_ulong_t)&config_pcf85063tp },
{ "pcf85063a", .driver_data = (kernel_ulong_t)&config_pcf85063a },
{ "rv8263", .driver_data = (kernel_ulong_t)&config_rv8263 },
{}
{ .name = "pca85073a", .driver_data = (kernel_ulong_t)&config_pcf85063a },
{ .name = "pcf85063", .driver_data = (kernel_ulong_t)&config_pcf85063 },
{ .name = "pcf85063tp", .driver_data = (kernel_ulong_t)&config_pcf85063tp },
{ .name = "pcf85063a", .driver_data = (kernel_ulong_t)&config_pcf85063a },
{ .name = "rv8263", .driver_data = (kernel_ulong_t)&config_rv8263 },
{ }
};
MODULE_DEVICE_TABLE(i2c, pcf85063_ids);

Some files were not shown because too many files have changed in this diff Show More