Message ID | 20240619193558.2543645-2-u.kleine-koenig@baylibre.com (mailing list archive) |
---|---|
State | Handled Elsewhere |
Headers | show |
Series | backlight: Drop explicit initialization of struct i2c_device_id::driver_data to 0 | expand |
On Wed, 19 Jun 2024 21:35:57 +0200, Uwe Kleine-König wrote: > 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. > > [...] Applied, thanks! [1/1] backlight: Drop explicit initialization of struct i2c_device_id::driver_data to 0 commit: bfd3587760498227510acc1b18c4299c7922ffe3 -- Lee Jones [李琼斯]
On Wed, Jun 19, 2024 at 09:35:57PM +0200, Uwe Kleine-König wrote: > 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 commas after the sentinel entries. > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Daniel.
diff --git a/drivers/video/backlight/adp8870_bl.c b/drivers/video/backlight/adp8870_bl.c index 6bb18dc970e9..ad4bd4c8f441 100644 --- a/drivers/video/backlight/adp8870_bl.c +++ b/drivers/video/backlight/adp8870_bl.c @@ -963,7 +963,7 @@ static SIMPLE_DEV_PM_OPS(adp8870_i2c_pm_ops, adp8870_i2c_suspend, adp8870_i2c_resume); static const struct i2c_device_id adp8870_id[] = { - { "adp8870", 0 }, + { "adp8870" }, { } }; MODULE_DEVICE_TABLE(i2c, adp8870_id); diff --git a/drivers/video/backlight/bd6107.c b/drivers/video/backlight/bd6107.c index 6be2c67ba85c..90764f83d2f1 100644 --- a/drivers/video/backlight/bd6107.c +++ b/drivers/video/backlight/bd6107.c @@ -180,7 +180,7 @@ static void bd6107_remove(struct i2c_client *client) } static const struct i2c_device_id bd6107_ids[] = { - { "bd6107", 0 }, + { "bd6107" }, { } }; MODULE_DEVICE_TABLE(i2c, bd6107_ids); diff --git a/drivers/video/backlight/ktz8866.c b/drivers/video/backlight/ktz8866.c index 014877b5a984..2e508741c0af 100644 --- a/drivers/video/backlight/ktz8866.c +++ b/drivers/video/backlight/ktz8866.c @@ -179,8 +179,8 @@ static void ktz8866_remove(struct i2c_client *client) } static const struct i2c_device_id ktz8866_ids[] = { - { "ktz8866", 0 }, - {}, + { "ktz8866" }, + {} }; MODULE_DEVICE_TABLE(i2c, ktz8866_ids); diff --git a/drivers/video/backlight/lm3509_bl.c b/drivers/video/backlight/lm3509_bl.c index c93cdedff5ad..11b8e1824e07 100644 --- a/drivers/video/backlight/lm3509_bl.c +++ b/drivers/video/backlight/lm3509_bl.c @@ -311,7 +311,10 @@ static void lm3509_remove(struct i2c_client *client) regmap_write(data->regmap, REG_GP, 0x00); } -static const struct i2c_device_id lm3509_id[] = { { LM3509_NAME, 0 }, {} }; +static const struct i2c_device_id lm3509_id[] = { + { LM3509_NAME }, + {} +}; MODULE_DEVICE_TABLE(i2c, lm3509_id); diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c index 76d47e2e8242..37651c2b9393 100644 --- a/drivers/video/backlight/lm3630a_bl.c +++ b/drivers/video/backlight/lm3630a_bl.c @@ -596,7 +596,7 @@ static void lm3630a_remove(struct i2c_client *client) } static const struct i2c_device_id lm3630a_id[] = { - {LM3630A_NAME, 0}, + { LM3630A_NAME }, {} }; diff --git a/drivers/video/backlight/lm3639_bl.c b/drivers/video/backlight/lm3639_bl.c index 564f62acd721..37ccc631c498 100644 --- a/drivers/video/backlight/lm3639_bl.c +++ b/drivers/video/backlight/lm3639_bl.c @@ -403,7 +403,7 @@ static void lm3639_remove(struct i2c_client *client) } static const struct i2c_device_id lm3639_id[] = { - {LM3639_NAME, 0}, + { LM3639_NAME }, {} }; diff --git a/drivers/video/backlight/lv5207lp.c b/drivers/video/backlight/lv5207lp.c index 0cf00fee0f60..5f60989fa70f 100644 --- a/drivers/video/backlight/lv5207lp.c +++ b/drivers/video/backlight/lv5207lp.c @@ -132,7 +132,7 @@ static void lv5207lp_remove(struct i2c_client *client) } static const struct i2c_device_id lv5207lp_ids[] = { - { "lv5207lp", 0 }, + { "lv5207lp" }, { } }; MODULE_DEVICE_TABLE(i2c, lv5207lp_ids); diff --git a/drivers/video/backlight/mp3309c.c b/drivers/video/backlight/mp3309c.c index a28036c964af..2bdb20129c81 100644 --- a/drivers/video/backlight/mp3309c.c +++ b/drivers/video/backlight/mp3309c.c @@ -400,7 +400,7 @@ static const struct of_device_id mp3309c_match_table[] = { MODULE_DEVICE_TABLE(of, mp3309c_match_table); static const struct i2c_device_id mp3309c_id[] = { - { "mp3309c", 0 }, + { "mp3309c" }, { } }; MODULE_DEVICE_TABLE(i2c, mp3309c_id);
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 commas after the sentinel entries. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com> --- drivers/video/backlight/adp8870_bl.c | 2 +- drivers/video/backlight/bd6107.c | 2 +- drivers/video/backlight/ktz8866.c | 4 ++-- drivers/video/backlight/lm3509_bl.c | 5 ++++- drivers/video/backlight/lm3630a_bl.c | 2 +- drivers/video/backlight/lm3639_bl.c | 2 +- drivers/video/backlight/lv5207lp.c | 2 +- drivers/video/backlight/mp3309c.c | 2 +- 8 files changed, 12 insertions(+), 9 deletions(-) base-commit: 2102cb0d050d34d50b9642a3a50861787527e922