mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 06:29:06 -04:00
clk: 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: Luca Ceresoli <luca.ceresoli@bootlin.com> # clk-versaclock5 Reviewed-by: Brian Masney <bmasney@redhat.com> Signed-off-by: Brian Masney <bmasney@redhat.com>
This commit is contained in:
committed by
Brian Masney
parent
f596486485
commit
cae51b908e
@@ -680,7 +680,7 @@ MODULE_DEVICE_TABLE(of, cdce706_dt_match);
|
||||
#endif
|
||||
|
||||
static const struct i2c_device_id cdce706_id[] = {
|
||||
{ "cdce706" },
|
||||
{ .name = "cdce706" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, cdce706_id);
|
||||
|
||||
@@ -826,10 +826,10 @@ static const struct clk_cdce925_chip_info clk_cdce949_info = {
|
||||
};
|
||||
|
||||
static const struct i2c_device_id cdce925_id[] = {
|
||||
{ "cdce913", (kernel_ulong_t)&clk_cdce913_info },
|
||||
{ "cdce925", (kernel_ulong_t)&clk_cdce925_info },
|
||||
{ "cdce937", (kernel_ulong_t)&clk_cdce937_info },
|
||||
{ "cdce949", (kernel_ulong_t)&clk_cdce949_info },
|
||||
{ .name = "cdce913", .driver_data = (kernel_ulong_t)&clk_cdce913_info },
|
||||
{ .name = "cdce925", .driver_data = (kernel_ulong_t)&clk_cdce925_info },
|
||||
{ .name = "cdce937", .driver_data = (kernel_ulong_t)&clk_cdce937_info },
|
||||
{ .name = "cdce949", .driver_data = (kernel_ulong_t)&clk_cdce949_info },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, cdce925_id);
|
||||
|
||||
@@ -122,8 +122,8 @@ static const struct of_device_id cs2000_of_match[] = {
|
||||
MODULE_DEVICE_TABLE(of, cs2000_of_match);
|
||||
|
||||
static const struct i2c_device_id cs2000_id[] = {
|
||||
{ "cs2000-cp", },
|
||||
{}
|
||||
{ .name = "cs2000-cp" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, cs2000_id);
|
||||
|
||||
|
||||
@@ -395,9 +395,9 @@ static const struct rs9_chip_info renesas_9fgv0841_info = {
|
||||
};
|
||||
|
||||
static const struct i2c_device_id rs9_id[] = {
|
||||
{ "9fgv0241", .driver_data = (kernel_ulong_t)&renesas_9fgv0241_info },
|
||||
{ "9fgv0441", .driver_data = (kernel_ulong_t)&renesas_9fgv0441_info },
|
||||
{ "9fgv0841", .driver_data = (kernel_ulong_t)&renesas_9fgv0841_info },
|
||||
{ .name = "9fgv0241", .driver_data = (kernel_ulong_t)&renesas_9fgv0241_info },
|
||||
{ .name = "9fgv0441", .driver_data = (kernel_ulong_t)&renesas_9fgv0441_info },
|
||||
{ .name = "9fgv0841", .driver_data = (kernel_ulong_t)&renesas_9fgv0841_info },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, rs9_id);
|
||||
|
||||
@@ -379,7 +379,7 @@ static int si514_probe(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id si514_id[] = {
|
||||
{ "si514" },
|
||||
{ .name = "si514" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, si514_id);
|
||||
|
||||
@@ -365,9 +365,9 @@ static int __maybe_unused si521xx_resume(struct device *dev)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id si521xx_id[] = {
|
||||
{ "si52144", .driver_data = SI521XX_OE_MAP(0x5, 0xc0) },
|
||||
{ "si52146", .driver_data = SI521XX_OE_MAP(0x15, 0xe0) },
|
||||
{ "si52147", .driver_data = SI521XX_OE_MAP(0x17, 0xf8) },
|
||||
{ .name = "si52144", .driver_data = SI521XX_OE_MAP(0x5, 0xc0) },
|
||||
{ .name = "si52146", .driver_data = SI521XX_OE_MAP(0x15, 0xe0) },
|
||||
{ .name = "si52147", .driver_data = SI521XX_OE_MAP(0x17, 0xf8) },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, si521xx_id);
|
||||
|
||||
@@ -1425,10 +1425,10 @@ si53351_of_clk_get(struct of_phandle_args *clkspec, void *data)
|
||||
#endif /* CONFIG_OF */
|
||||
|
||||
static const struct i2c_device_id si5351_i2c_ids[] = {
|
||||
{ "si5351a", SI5351_VARIANT_A },
|
||||
{ "si5351a-msop", SI5351_VARIANT_A3 },
|
||||
{ "si5351b", SI5351_VARIANT_B },
|
||||
{ "si5351c", SI5351_VARIANT_C },
|
||||
{ .name = "si5351a", .driver_data = SI5351_VARIANT_A },
|
||||
{ .name = "si5351a-msop", .driver_data = SI5351_VARIANT_A3 },
|
||||
{ .name = "si5351b", .driver_data = SI5351_VARIANT_B },
|
||||
{ .name = "si5351c", .driver_data = SI5351_VARIANT_C },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, si5351_i2c_ids);
|
||||
|
||||
@@ -479,9 +479,9 @@ static int si544_probe(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id si544_id[] = {
|
||||
{ "si544a", 1500000000 },
|
||||
{ "si544b", 800000000 },
|
||||
{ "si544c", 350000000 },
|
||||
{ .name = "si544a", .driver_data = 1500000000 },
|
||||
{ .name = "si544b", .driver_data = 800000000 },
|
||||
{ .name = "si544c", .driver_data = 350000000 },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, si544_id);
|
||||
|
||||
@@ -503,10 +503,10 @@ static const struct clk_si570_info clk_si590_info = {
|
||||
};
|
||||
|
||||
static const struct i2c_device_id si570_id[] = {
|
||||
{ "si570", (kernel_ulong_t)&clk_si570_info },
|
||||
{ "si571", (kernel_ulong_t)&clk_si570_info },
|
||||
{ "si598", (kernel_ulong_t)&clk_si590_info },
|
||||
{ "si599", (kernel_ulong_t)&clk_si590_info },
|
||||
{ .name = "si570", .driver_data = (kernel_ulong_t)&clk_si570_info },
|
||||
{ .name = "si571", .driver_data = (kernel_ulong_t)&clk_si570_info },
|
||||
{ .name = "si598", .driver_data = (kernel_ulong_t)&clk_si590_info },
|
||||
{ .name = "si599", .driver_data = (kernel_ulong_t)&clk_si590_info },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, si570_id);
|
||||
|
||||
@@ -1311,14 +1311,14 @@ static const struct vc5_chip_info idt_5p49v6975_info = {
|
||||
};
|
||||
|
||||
static const struct i2c_device_id vc5_id[] = {
|
||||
{ "5p49v5923", .driver_data = (kernel_ulong_t)&idt_5p49v5923_info },
|
||||
{ "5p49v5925", .driver_data = (kernel_ulong_t)&idt_5p49v5925_info },
|
||||
{ "5p49v5933", .driver_data = (kernel_ulong_t)&idt_5p49v5933_info },
|
||||
{ "5p49v5935", .driver_data = (kernel_ulong_t)&idt_5p49v5935_info },
|
||||
{ "5p49v60", .driver_data = (kernel_ulong_t)&idt_5p49v60_info },
|
||||
{ "5p49v6901", .driver_data = (kernel_ulong_t)&idt_5p49v6901_info },
|
||||
{ "5p49v6965", .driver_data = (kernel_ulong_t)&idt_5p49v6965_info },
|
||||
{ "5p49v6975", .driver_data = (kernel_ulong_t)&idt_5p49v6975_info },
|
||||
{ .name = "5p49v5923", .driver_data = (kernel_ulong_t)&idt_5p49v5923_info },
|
||||
{ .name = "5p49v5925", .driver_data = (kernel_ulong_t)&idt_5p49v5925_info },
|
||||
{ .name = "5p49v5933", .driver_data = (kernel_ulong_t)&idt_5p49v5933_info },
|
||||
{ .name = "5p49v5935", .driver_data = (kernel_ulong_t)&idt_5p49v5935_info },
|
||||
{ .name = "5p49v60", .driver_data = (kernel_ulong_t)&idt_5p49v60_info },
|
||||
{ .name = "5p49v6901", .driver_data = (kernel_ulong_t)&idt_5p49v6901_info },
|
||||
{ .name = "5p49v6965", .driver_data = (kernel_ulong_t)&idt_5p49v6965_info },
|
||||
{ .name = "5p49v6975", .driver_data = (kernel_ulong_t)&idt_5p49v6975_info },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, vc5_id);
|
||||
|
||||
@@ -1288,8 +1288,8 @@ static const struct regmap_config vc7_regmap_config = {
|
||||
};
|
||||
|
||||
static const struct i2c_device_id vc7_i2c_id[] = {
|
||||
{ "rc21008a", .driver_data = (kernel_ulong_t)&vc7_rc21008a_info },
|
||||
{}
|
||||
{ .name = "rc21008a", .driver_data = (kernel_ulong_t)&vc7_rc21008a_info },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, vc7_i2c_id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user