]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
i2c: Drop explicit initialization of struct i2c_device_id::driver_data to 0
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>
Tue, 25 Jun 2024 08:31:31 +0000 (10:31 +0200)
committerWolfram Sang <wsa+renesas@sang-engineering.com>
Wed, 26 Jun 2024 10:45:25 +0000 (12:45 +0200)
These drivers don't use the driver_data member of struct i2c_device_id,
so don't explicitly initialize this member.

This prepares putting driver_data in an anonymous union which requires
either no initialization or named designators. But it's also a nice
cleanup on its own.

While add it, also remove a comma after the sentinel entry.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
drivers/i2c/i2c-core-base.c
drivers/i2c/i2c-slave-testunit.c
drivers/i2c/i2c-smbus.c
drivers/i2c/muxes/i2c-mux-pca9541.c

index db0d1ac82910e558b8df2e4e7f1c1f6535a06eaf..49fdcb3eb8f66c08d4d13d88d45c9424d764cf9f 100644 (file)
@@ -1066,8 +1066,8 @@ EXPORT_SYMBOL(i2c_find_device_by_fwnode);
 
 
 static const struct i2c_device_id dummy_id[] = {
-       { "dummy", 0 },
-       { },
+       { "dummy" },
+       { }
 };
 
 static int dummy_probe(struct i2c_client *client)
index a49642bbae4b7077f7fa3af34f9423d6dba58045..fd57b9bb23569ad711b8d75d36f87f995ff8c992 100644 (file)
@@ -162,7 +162,7 @@ static void i2c_slave_testunit_remove(struct i2c_client *client)
 }
 
 static const struct i2c_device_id i2c_slave_testunit_id[] = {
-       { "slave-testunit", 0 },
+       { "slave-testunit" },
        { }
 };
 MODULE_DEVICE_TABLE(i2c, i2c_slave_testunit_id);
index 97f338b123b11872402df5d84ef7c20ef33454f2..5a16bf01402c8423f709f1dff6a892b7b6896bf5 100644 (file)
@@ -160,7 +160,7 @@ static void smbalert_remove(struct i2c_client *ara)
 }
 
 static const struct i2c_device_id smbalert_ids[] = {
-       { "smbus_alert", 0 },
+       { "smbus_alert" },
        { /* LIST END */ }
 };
 MODULE_DEVICE_TABLE(i2c, smbalert_ids);
index e28694d991fb07ab1148de950da80189fd6f133a..8663c8a7c2693638c65a486a9bfb7f7cd14d9fa5 100644 (file)
@@ -78,7 +78,7 @@ struct pca9541 {
 };
 
 static const struct i2c_device_id pca9541_id[] = {
-       {"pca9541", 0},
+       { "pca9541" },
        {}
 };