Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: Drop explicit initialization of struct i2c_device_id::driver_data to 0 (part 2)

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.

This is a follow up to commit d8a66f3621c2 ("hwmon: Drop explicit
initialization of struct i2c_device_id::driver_data to 0") which I
created before identifying a few corner cases in my conversion script.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20240508072027.2119857-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Uwe Kleine-König and committed by
Guenter Roeck
2fa36597 6a815781

+5 -5
+1 -1
drivers/hwmon/lm87.c
··· 976 976 977 977 static const struct i2c_device_id lm87_id[] = { 978 978 { "lm87" }, 979 - { "adm1024", 0 }, 979 + { "adm1024" }, 980 980 { } 981 981 }; 982 982 MODULE_DEVICE_TABLE(i2c, lm87_id);
+1 -1
drivers/hwmon/lm95241.c
··· 458 458 /* Driver data (common to all clients) */ 459 459 static const struct i2c_device_id lm95241_id[] = { 460 460 { "lm95231" }, 461 - { "lm95241", 0 }, 461 + { "lm95241" }, 462 462 { } 463 463 }; 464 464 MODULE_DEVICE_TABLE(i2c, lm95241_id);
+1 -1
drivers/hwmon/max6621.c
··· 537 537 } 538 538 539 539 static const struct i2c_device_id max6621_id[] = { 540 - { MAX6621_DRV_NAME, 0 }, 540 + { MAX6621_DRV_NAME }, 541 541 { } 542 542 }; 543 543 MODULE_DEVICE_TABLE(i2c, max6621_id);
+2 -2
drivers/hwmon/pmbus/max15301.c
··· 23 23 #include "pmbus.h" 24 24 25 25 static const struct i2c_device_id max15301_id[] = { 26 - {"bmr461"}, 27 - {"max15301", 0}, 26 + { "bmr461" }, 27 + { "max15301" }, 28 28 {} 29 29 }; 30 30 MODULE_DEVICE_TABLE(i2c, max15301_id);