Skip to content

Commit d08ed10

Browse files
ukleinekWolfram Sang
authored andcommitted
i2c: Drop explicit initialization of struct i2c_device_id::driver_data to 0
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 <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 256ed31 commit d08ed10

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

drivers/i2c/i2c-core-base.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,8 +1066,8 @@ EXPORT_SYMBOL(i2c_find_device_by_fwnode);
10661066

10671067

10681068
static const struct i2c_device_id dummy_id[] = {
1069-
{ "dummy", 0 },
1070-
{ },
1069+
{ "dummy" },
1070+
{ }
10711071
};
10721072

10731073
static int dummy_probe(struct i2c_client *client)

drivers/i2c/i2c-slave-testunit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ static void i2c_slave_testunit_remove(struct i2c_client *client)
162162
}
163163

164164
static const struct i2c_device_id i2c_slave_testunit_id[] = {
165-
{ "slave-testunit", 0 },
165+
{ "slave-testunit" },
166166
{ }
167167
};
168168
MODULE_DEVICE_TABLE(i2c, i2c_slave_testunit_id);

drivers/i2c/i2c-smbus.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ static void smbalert_remove(struct i2c_client *ara)
160160
}
161161

162162
static const struct i2c_device_id smbalert_ids[] = {
163-
{ "smbus_alert", 0 },
163+
{ "smbus_alert" },
164164
{ /* LIST END */ }
165165
};
166166
MODULE_DEVICE_TABLE(i2c, smbalert_ids);

drivers/i2c/muxes/i2c-mux-pca9541.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ struct pca9541 {
7878
};
7979

8080
static const struct i2c_device_id pca9541_id[] = {
81-
{"pca9541", 0},
81+
{ "pca9541" },
8282
{}
8383
};
8484

0 commit comments

Comments
 (0)