mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 10:00:03 -04:00
drm/bridge: 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 in the list terminator and drop trailing commas there. This patch doesn't modify the compiled arrays, only their representation in source form benefits. The former was confirmed with x86 and arm64 builds. Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com> Acked-by: Douglas Anderson <dianders@chromium.org> # ti-sn65dsi86.c Link: https://patch.msgid.link/9fa3a8e372b7211c06ec885617051f5006227e3a.1784545092.git.u.kleine-koenig@baylibre.com Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
This commit is contained in:
committed by
Luca Ceresoli
parent
09b195a7bb
commit
a2a3348028
@@ -1471,11 +1471,11 @@ static const struct adv7511_chip_info adv7535_chip_info = {
|
||||
};
|
||||
|
||||
static const struct i2c_device_id adv7511_i2c_ids[] = {
|
||||
{ "adv7511", (kernel_ulong_t)&adv7511_chip_info },
|
||||
{ "adv7511w", (kernel_ulong_t)&adv7511_chip_info },
|
||||
{ "adv7513", (kernel_ulong_t)&adv7511_chip_info },
|
||||
{ "adv7533", (kernel_ulong_t)&adv7533_chip_info },
|
||||
{ "adv7535", (kernel_ulong_t)&adv7535_chip_info },
|
||||
{ .name = "adv7511", .driver_data = (kernel_ulong_t)&adv7511_chip_info },
|
||||
{ .name = "adv7511w", .driver_data = (kernel_ulong_t)&adv7511_chip_info },
|
||||
{ .name = "adv7513", .driver_data = (kernel_ulong_t)&adv7511_chip_info },
|
||||
{ .name = "adv7533", .driver_data = (kernel_ulong_t)&adv7533_chip_info },
|
||||
{ .name = "adv7535", .driver_data = (kernel_ulong_t)&adv7535_chip_info },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, adv7511_i2c_ids);
|
||||
|
||||
@@ -783,7 +783,7 @@ static void anx6345_i2c_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id anx6345_id[] = {
|
||||
{ "anx6345" },
|
||||
{ .name = "anx6345" },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, anx6345_id);
|
||||
|
||||
@@ -2993,8 +2993,8 @@ static void anx7625_i2c_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id anx7625_id[] = {
|
||||
{ "anx7625" },
|
||||
{}
|
||||
{ .name = "anx7625" },
|
||||
{ }
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(i2c, anx7625_id);
|
||||
|
||||
@@ -784,8 +784,8 @@ static struct mipi_dsi_driver chipone_dsi_driver = {
|
||||
};
|
||||
|
||||
static const struct i2c_device_id chipone_i2c_id[] = {
|
||||
{ "chipone,icn6211" },
|
||||
{},
|
||||
{ .name = "chipone,icn6211" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, chipone_i2c_id);
|
||||
|
||||
|
||||
@@ -601,7 +601,7 @@ static const struct of_device_id ch7033_dt_ids[] = {
|
||||
MODULE_DEVICE_TABLE(of, ch7033_dt_ids);
|
||||
|
||||
static const struct i2c_device_id ch7033_ids[] = {
|
||||
{ "ch7033" },
|
||||
{ .name = "ch7033" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, ch7033_ids);
|
||||
|
||||
@@ -910,7 +910,7 @@ static const struct of_device_id it6263_of_match[] = {
|
||||
MODULE_DEVICE_TABLE(of, it6263_of_match);
|
||||
|
||||
static const struct i2c_device_id it6263_i2c_ids[] = {
|
||||
{ "it6263" },
|
||||
{ .name = "it6263" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, it6263_i2c_ids);
|
||||
|
||||
@@ -3652,7 +3652,7 @@ static void it6505_i2c_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id it6505_id[] = {
|
||||
{ "it6505" },
|
||||
{ .name = "it6505" },
|
||||
{ }
|
||||
};
|
||||
|
||||
|
||||
@@ -572,7 +572,7 @@ static void lt8713sx_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static struct i2c_device_id lt8713sx_id[] = {
|
||||
{ "lontium,lt8713sx", 0 },
|
||||
{ .name = "lontium,lt8713sx" },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
|
||||
|
||||
@@ -820,8 +820,8 @@ static const struct of_device_id lt8912_dt_match[] = {
|
||||
MODULE_DEVICE_TABLE(of, lt8912_dt_match);
|
||||
|
||||
static const struct i2c_device_id lt8912_id[] = {
|
||||
{ "lt8912" },
|
||||
{}
|
||||
{ .name = "lt8912" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, lt8912_id);
|
||||
|
||||
|
||||
@@ -773,8 +773,8 @@ static void lt9211_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id lt9211_id[] = {
|
||||
{ "lontium,lt9211" },
|
||||
{},
|
||||
{ .name = "lontium,lt9211" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, lt9211_id);
|
||||
|
||||
|
||||
@@ -1229,8 +1229,8 @@ static void lt9611_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id lt9611_id[] = {
|
||||
{ "lontium,lt9611" },
|
||||
{}
|
||||
{ .name = "lontium,lt9611" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, lt9611_id);
|
||||
|
||||
|
||||
@@ -899,7 +899,7 @@ static void lt9611uxc_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id lt9611uxc_id[] = {
|
||||
{ "lontium,lt9611uxc" },
|
||||
{ .name = "lontium,lt9611uxc" },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
|
||||
|
||||
@@ -317,8 +317,8 @@ static void stdp4028_ge_b850v3_fw_remove(struct i2c_client *stdp4028_i2c)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id stdp4028_ge_b850v3_fw_i2c_table[] = {
|
||||
{ "stdp4028_ge_fw" },
|
||||
{}
|
||||
{ .name = "stdp4028_ge_fw" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, stdp4028_ge_b850v3_fw_i2c_table);
|
||||
|
||||
@@ -364,8 +364,8 @@ static void stdp2690_ge_b850v3_fw_remove(struct i2c_client *stdp2690_i2c)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id stdp2690_ge_b850v3_fw_i2c_table[] = {
|
||||
{ "stdp2690_ge_fw" },
|
||||
{}
|
||||
{ .name = "stdp2690_ge_fw" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, stdp2690_ge_b850v3_fw_i2c_table);
|
||||
|
||||
|
||||
@@ -323,8 +323,8 @@ static void ptn3460_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id ptn3460_i2c_table[] = {
|
||||
{ "ptn3460" },
|
||||
{}
|
||||
{ .name = "ptn3460" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, ptn3460_i2c_table);
|
||||
|
||||
|
||||
@@ -534,10 +534,10 @@ static void ps8622_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id ps8622_i2c_table[] = {
|
||||
/* Device type, max_lane_count */
|
||||
{"ps8622", 1},
|
||||
{"ps8625", 2},
|
||||
{},
|
||||
/* Device type, driver_data holds the maximal lane_count */
|
||||
{ .name = "ps8622", .driver_data = 1 },
|
||||
{ .name = "ps8625", .driver_data = 2 },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, ps8622_i2c_table);
|
||||
|
||||
|
||||
@@ -1235,7 +1235,7 @@ static const struct of_device_id sii902x_dt_ids[] = {
|
||||
MODULE_DEVICE_TABLE(of, sii902x_dt_ids);
|
||||
|
||||
static const struct i2c_device_id sii902x_i2c_ids[] = {
|
||||
{ "sii9022" },
|
||||
{ .name = "sii9022" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, sii902x_i2c_ids);
|
||||
|
||||
@@ -944,7 +944,7 @@ static const struct of_device_id sii9234_dt_match[] = {
|
||||
MODULE_DEVICE_TABLE(of, sii9234_dt_match);
|
||||
|
||||
static const struct i2c_device_id sii9234_id[] = {
|
||||
{ "SII9234" },
|
||||
{ .name = "SII9234" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, sii9234_id);
|
||||
|
||||
@@ -2374,7 +2374,7 @@ static const struct of_device_id sii8620_dt_match[] = {
|
||||
MODULE_DEVICE_TABLE(of, sii8620_dt_match);
|
||||
|
||||
static const struct i2c_device_id sii8620_id[] = {
|
||||
{ "sii8620" },
|
||||
{ .name = "sii8620" },
|
||||
{ }
|
||||
};
|
||||
|
||||
|
||||
@@ -2613,7 +2613,7 @@ static void tc_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id tc358767_i2c_ids[] = {
|
||||
{ "tc358767" },
|
||||
{ .name = "tc358767" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, tc358767_i2c_ids);
|
||||
|
||||
@@ -1362,8 +1362,8 @@ static const struct regmap_config tc358768_regmap_config = {
|
||||
};
|
||||
|
||||
static const struct i2c_device_id tc358768_i2c_ids[] = {
|
||||
{ "tc358768" },
|
||||
{ "tc358778" },
|
||||
{ .name = "tc358768" },
|
||||
{ .name = "tc358778" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, tc358768_i2c_ids);
|
||||
|
||||
@@ -727,8 +727,8 @@ static void tc_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id tc358775_i2c_ids[] = {
|
||||
{ "tc358765", TC358765, },
|
||||
{ "tc358775", TC358775, },
|
||||
{ .name = "tc358765", .driver_data = TC358765 },
|
||||
{ .name = "tc358775", .driver_data = TC358775 },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, tc358775_i2c_ids);
|
||||
|
||||
@@ -2064,7 +2064,7 @@ MODULE_DEVICE_TABLE(of, tda998x_dt_ids);
|
||||
#endif
|
||||
|
||||
static const struct i2c_device_id tda998x_ids[] = {
|
||||
{ "tda998x" },
|
||||
{ .name = "tda998x" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, tda998x_ids);
|
||||
|
||||
@@ -389,7 +389,7 @@ static void dlpc3433_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id dlpc3433_id[] = {
|
||||
{ "ti,dlpc3433" },
|
||||
{ .name = "ti,dlpc3433" },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, dlpc3433_id);
|
||||
|
||||
@@ -1072,9 +1072,9 @@ static void sn65dsi83_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id sn65dsi83_id[] = {
|
||||
{ "ti,sn65dsi83", MODEL_SN65DSI83 },
|
||||
{ "ti,sn65dsi84", MODEL_SN65DSI84 },
|
||||
{},
|
||||
{ .name = "ti,sn65dsi83", .driver_data = MODEL_SN65DSI83 },
|
||||
{ .name = "ti,sn65dsi84", .driver_data = MODEL_SN65DSI84 },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, sn65dsi83_id);
|
||||
|
||||
|
||||
@@ -2116,8 +2116,8 @@ static int ti_sn65dsi86_probe(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id ti_sn65dsi86_id[] = {
|
||||
{ "ti,sn65dsi86" },
|
||||
{}
|
||||
{ .name = "ti,sn65dsi86" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, ti_sn65dsi86_id);
|
||||
|
||||
|
||||
@@ -437,7 +437,7 @@ static void tfp410_i2c_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id tfp410_i2c_ids[] = {
|
||||
{ "tfp410" },
|
||||
{ .name = "tfp410" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, tfp410_i2c_ids);
|
||||
|
||||
Reference in New Issue
Block a user