misc: Use named initializers for arrays of spi_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
spi_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 <ukleinek@kernel.org>
Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Link: https://patch.msgid.link/ad1f0b3efcc3d9d362b33753734cfb064c079cd3.1784299069.git.u.kleine-koenig@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Uwe Kleine-König (The Capable Hub)
2026-07-17 16:50:52 +02:00
committed by Greg Kroah-Hartman
parent a4fa3300f0
commit 3e97a4e171
4 changed files with 35 additions and 35 deletions

View File

@@ -96,35 +96,35 @@ static void ad_dpot_spi_remove(struct spi_device *spi)
}
static const struct spi_device_id ad_dpot_spi_id[] = {
{"ad5160", AD5160_ID},
{"ad5161", AD5161_ID},
{"ad5162", AD5162_ID},
{"ad5165", AD5165_ID},
{"ad5200", AD5200_ID},
{"ad5201", AD5201_ID},
{"ad5203", AD5203_ID},
{"ad5204", AD5204_ID},
{"ad5206", AD5206_ID},
{"ad5207", AD5207_ID},
{"ad5231", AD5231_ID},
{"ad5232", AD5232_ID},
{"ad5233", AD5233_ID},
{"ad5235", AD5235_ID},
{"ad5260", AD5260_ID},
{"ad5262", AD5262_ID},
{"ad5263", AD5263_ID},
{"ad5290", AD5290_ID},
{"ad5291", AD5291_ID},
{"ad5292", AD5292_ID},
{"ad5293", AD5293_ID},
{"ad7376", AD7376_ID},
{"ad8400", AD8400_ID},
{"ad8402", AD8402_ID},
{"ad8403", AD8403_ID},
{"adn2850", ADN2850_ID},
{"ad5270", AD5270_ID},
{"ad5271", AD5271_ID},
{}
{ .name = "ad5160", .driver_data = AD5160_ID },
{ .name = "ad5161", .driver_data = AD5161_ID },
{ .name = "ad5162", .driver_data = AD5162_ID },
{ .name = "ad5165", .driver_data = AD5165_ID },
{ .name = "ad5200", .driver_data = AD5200_ID },
{ .name = "ad5201", .driver_data = AD5201_ID },
{ .name = "ad5203", .driver_data = AD5203_ID },
{ .name = "ad5204", .driver_data = AD5204_ID },
{ .name = "ad5206", .driver_data = AD5206_ID },
{ .name = "ad5207", .driver_data = AD5207_ID },
{ .name = "ad5231", .driver_data = AD5231_ID },
{ .name = "ad5232", .driver_data = AD5232_ID },
{ .name = "ad5233", .driver_data = AD5233_ID },
{ .name = "ad5235", .driver_data = AD5235_ID },
{ .name = "ad5260", .driver_data = AD5260_ID },
{ .name = "ad5262", .driver_data = AD5262_ID },
{ .name = "ad5263", .driver_data = AD5263_ID },
{ .name = "ad5290", .driver_data = AD5290_ID },
{ .name = "ad5291", .driver_data = AD5291_ID },
{ .name = "ad5292", .driver_data = AD5292_ID },
{ .name = "ad5293", .driver_data = AD5293_ID },
{ .name = "ad7376", .driver_data = AD7376_ID },
{ .name = "ad8400", .driver_data = AD8400_ID },
{ .name = "ad8402", .driver_data = AD8402_ID },
{ .name = "ad8403", .driver_data = AD8403_ID },
{ .name = "adn2850", .driver_data = ADN2850_ID },
{ .name = "ad5270", .driver_data = AD5270_ID },
{ .name = "ad5271", .driver_data = AD5271_ID },
{ }
};
MODULE_DEVICE_TABLE(spi, ad_dpot_spi_id);

View File

@@ -538,8 +538,8 @@ static int gehc_achc_probe(struct spi_device *spi)
}
static const struct spi_device_id gehc_achc_id[] = {
{ "ge,achc" },
{ "achc" },
{ .name = "ge,achc" },
{ .name = "achc" },
{ }
};
MODULE_DEVICE_TABLE(spi, gehc_achc_id);

View File

@@ -339,8 +339,8 @@ static int lan9252_probe(struct spi_device *spi)
}
static const struct spi_device_id lan9252_id[] = {
{"lan9252"},
{}
{ .name = "lan9252" },
{ }
};
MODULE_DEVICE_TABLE(spi, lan9252_id);

View File

@@ -219,8 +219,8 @@ static void lattice_ecp3_remove(struct spi_device *spi)
}
static const struct spi_device_id lattice_ecp3_id[] = {
{ "ecp3-17" },
{ "ecp3-35" },
{ .name = "ecp3-17" },
{ .name = "ecp3-35" },
{ }
};
MODULE_DEVICE_TABLE(spi, lattice_ecp3_id);