mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 04:37:32 -04:00
usb: typec: 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. 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> Link: https://patch.msgid.link/20260518110142.637215-2-u.kleine-koenig@baylibre.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
84d2b46ec1
commit
52be520ca9
@@ -1577,8 +1577,8 @@ static void anx7411_i2c_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id anx7411_id[] = {
|
||||
{ "anx7411" },
|
||||
{}
|
||||
{ .name = "anx7411" },
|
||||
{ }
|
||||
};
|
||||
|
||||
MODULE_DEVICE_TABLE(i2c, anx7411_id);
|
||||
|
||||
@@ -336,7 +336,7 @@ static void fsa4480_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id fsa4480_table[] = {
|
||||
{ "fsa4480" },
|
||||
{ .name = "fsa4480" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, fsa4480_table);
|
||||
|
||||
@@ -266,7 +266,7 @@ static void it5205_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id it5205_table[] = {
|
||||
{ "it5205" },
|
||||
{ .name = "it5205" },
|
||||
{ /* sentinel */ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, it5205_table);
|
||||
|
||||
@@ -499,7 +499,7 @@ static void nb7vpq904m_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id nb7vpq904m_table[] = {
|
||||
{ "nb7vpq904m" },
|
||||
{ .name = "nb7vpq904m" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, nb7vpq904m_table);
|
||||
|
||||
@@ -169,7 +169,7 @@ static void pi3usb30532_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id pi3usb30532_table[] = {
|
||||
{ "pi3usb30532" },
|
||||
{ .name = "pi3usb30532" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, pi3usb30532_table);
|
||||
|
||||
@@ -404,7 +404,7 @@ static void ptn36502_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id ptn36502_table[] = {
|
||||
{ "ptn36502" },
|
||||
{ .name = "ptn36502" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, ptn36502_table);
|
||||
|
||||
@@ -753,7 +753,7 @@ static void wcd939x_usbss_remove(struct i2c_client *client)
|
||||
}
|
||||
|
||||
static const struct i2c_device_id wcd939x_usbss_table[] = {
|
||||
{ "wcd9390-usbss" },
|
||||
{ .name = "wcd9390-usbss" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, wcd939x_usbss_table);
|
||||
|
||||
@@ -1841,8 +1841,8 @@ static const struct of_device_id fusb302_dt_match[] __maybe_unused = {
|
||||
MODULE_DEVICE_TABLE(of, fusb302_dt_match);
|
||||
|
||||
static const struct i2c_device_id fusb302_i2c_device_id[] = {
|
||||
{ "typec_fusb302" },
|
||||
{}
|
||||
{ .name = "typec_fusb302" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, fusb302_i2c_device_id);
|
||||
|
||||
|
||||
@@ -1017,7 +1017,7 @@ static int tcpci_resume(struct device *dev)
|
||||
static DEFINE_SIMPLE_DEV_PM_OPS(tcpci_pm_ops, tcpci_suspend, tcpci_resume);
|
||||
|
||||
static const struct i2c_device_id tcpci_id[] = {
|
||||
{ "tcpci" },
|
||||
{ .name = "tcpci" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, tcpci_id);
|
||||
|
||||
@@ -570,7 +570,7 @@ static int max_tcpci_suspend(struct device *dev)
|
||||
static SIMPLE_DEV_PM_OPS(max_tcpci_pm_ops, max_tcpci_suspend, max_tcpci_resume);
|
||||
|
||||
static const struct i2c_device_id max_tcpci_id[] = {
|
||||
{ "maxtcpc" },
|
||||
{ .name = "maxtcpc" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, max_tcpci_id);
|
||||
|
||||
@@ -373,10 +373,10 @@ static const struct rt1711h_chip_info rt1715 = {
|
||||
};
|
||||
|
||||
static const struct i2c_device_id rt1711h_id[] = {
|
||||
{ "et7304", (kernel_ulong_t)&rt1715 },
|
||||
{ "rt1711h", (kernel_ulong_t)&rt1711h },
|
||||
{ "rt1715", (kernel_ulong_t)&rt1715 },
|
||||
{}
|
||||
{ .name = "et7304", .driver_data = (kernel_ulong_t)&rt1715 },
|
||||
{ .name = "rt1711h", .driver_data = (kernel_ulong_t)&rt1711h },
|
||||
{ .name = "rt1715", .driver_data = (kernel_ulong_t)&rt1715 },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, rt1711h_id);
|
||||
|
||||
|
||||
@@ -2027,7 +2027,7 @@ static const struct of_device_id tps6598x_of_match[] = {
|
||||
MODULE_DEVICE_TABLE(of, tps6598x_of_match);
|
||||
|
||||
static const struct i2c_device_id tps6598x_id[] = {
|
||||
{ "tps6598x", (kernel_ulong_t)&tps6598x_data },
|
||||
{ .name = "tps6598x", .driver_data = (kernel_ulong_t)&tps6598x_data },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, tps6598x_id);
|
||||
|
||||
@@ -1525,8 +1525,8 @@ static const struct of_device_id ucsi_ccg_of_match_table[] = {
|
||||
MODULE_DEVICE_TABLE(of, ucsi_ccg_of_match_table);
|
||||
|
||||
static const struct i2c_device_id ucsi_ccg_device_id[] = {
|
||||
{ "ccgx-ucsi" },
|
||||
{}
|
||||
{ .name = "ccgx-ucsi" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, ucsi_ccg_device_id);
|
||||
|
||||
|
||||
@@ -737,8 +737,8 @@ static const struct of_device_id __maybe_unused ucsi_stm32g0_typec_of_match[] =
|
||||
MODULE_DEVICE_TABLE(of, ucsi_stm32g0_typec_of_match);
|
||||
|
||||
static const struct i2c_device_id ucsi_stm32g0_typec_i2c_devid[] = {
|
||||
{ "stm32g0-typec" },
|
||||
{}
|
||||
{ .name = "stm32g0-typec" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(i2c, ucsi_stm32g0_typec_i2c_devid);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user