summaryrefslogtreecommitdiff
path: root/drivers/iio/imu/bmi160
diff options
context:
space:
mode:
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>2026-05-19 10:13:09 +0200
committerJonathan Cameron <jic23@kernel.org>2026-05-31 11:01:46 +0100
commitf68afce8e8a74f52a879f56f607dfedf552b5ab5 (patch)
tree87b2f99b3e0b31a3e23fd48b2a3e6c5a6fe851af /drivers/iio/imu/bmi160
parentc4657858d43ada628e2f4eaf591c43efb3649933 (diff)
downloadlinux-next-f68afce8e8a74f52a879f56f607dfedf552b5ab5.tar.gz
linux-next-f68afce8e8a74f52a879f56f607dfedf552b5ab5.zip
iio: Initialize i2c_device_id arrays using member names
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. 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: Siratul Islam <email@sirat.me> Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/imu/bmi160')
-rw-r--r--drivers/iio/imu/bmi160/bmi160_i2c.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/imu/bmi160/bmi160_i2c.c b/drivers/iio/imu/bmi160/bmi160_i2c.c
index 3e2758f4e0d3..29f3c4acb123 100644
--- a/drivers/iio/imu/bmi160/bmi160_i2c.c
+++ b/drivers/iio/imu/bmi160/bmi160_i2c.c
@@ -38,8 +38,8 @@ static int bmi160_i2c_probe(struct i2c_client *client)
}
static const struct i2c_device_id bmi160_i2c_id[] = {
- { "bmi120" },
- { "bmi160" },
+ { .name = "bmi120" },
+ { .name = "bmi160" },
{ }
};
MODULE_DEVICE_TABLE(i2c, bmi160_i2c_id);