[PATCH v1 2/2] ASoC: Use named initializers for arrays of i2c_device_data
Krzysztof Kozlowski
krzk at kernel.org
Wed May 13 22:59:38 PDT 2026
On 13/05/2026 21:00, Krzysztof Kozlowski wrote:
> On 13/05/2026 19:23, Uwe Kleine-König (The Capable Hub) wrote:
>> MODULE_DEVICE_TABLE(i2c, adau1372_i2c_ids);
>> diff --git a/sound/soc/codecs/adau1373.c b/sound/soc/codecs/adau1373.c
>> index 16b9b2658341..5dd961b233ce 100644
>> --- a/sound/soc/codecs/adau1373.c
>> +++ b/sound/soc/codecs/adau1373.c
>> @@ -1599,7 +1599,7 @@ static int adau1373_i2c_probe(struct i2c_client *client)
>> }
>>
>> static const struct i2c_device_id adau1373_i2c_id[] = {
>> - { "adau1373" },
>> + { .name = "adau1373" },
>> { }
>> };
>
> This is inconsistent with most (or all?) of other xx_device_id table
> usages and, IIUC, is not even necessary to achieve your goal (which
> itself is good).
After talking on IRC, I see that actually many of platform_device_id use
named initializers for '.name' and PCI uses macro for that, thus my
"consistency" concern is not really valid. Especially that if you change
i2c and spi tables, the named initializers might be more frequent...
Best regards,
Krzysztof
More information about the Linux-mediatek
mailing list