Re: [PATCH v2 5/6] ASoC: Use named initializers for platform_device_id arrays

Péter Ujfalusi <[email protected]>
Newsgroups gmane.linux.sound,gmane.linux.kernel
Message-ID <[email protected]>

On 20/07/2026 09:23, Uwe Kleine-König (The Capable Hub) wrote:
> Named initializers are better readable and more robust to changes of the
> struct definition. This robustness is relevant for a planned change to
> struct platform_device_id replacing .driver_data by an anonymous union.
> 
> While touching these arrays unify spacing and usage of commas.
> 
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <[email protected]>

Reviewed-by: Peter Ujfalusi <[email protected]>

> ---
>  sound/soc/codecs/cs40l50-codec.c | 4 ++--
>  sound/soc/codecs/cs42l43.c       | 4 ++--
>  sound/soc/intel/boards/sof_sdw.c | 4 ++--
>  3 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/sound/soc/codecs/cs40l50-codec.c b/sound/soc/codecs/cs40l50-codec.c
> index aa629ef53db4..676367163067 100644
> --- a/sound/soc/codecs/cs40l50-codec.c
> +++ b/sound/soc/codecs/cs40l50-codec.c
> @@ -288,8 +288,8 @@ static int cs40l50_codec_driver_probe(struct platform_device *pdev)
>  }
>  
>  static const struct platform_device_id cs40l50_id[] = {
> -	{ "cs40l50-codec", },
> -	{}
> +	{ .name = "cs40l50-codec" },
> +	{ }
>  };
>  MODULE_DEVICE_TABLE(platform, cs40l50_id);
>  
> diff --git a/sound/soc/codecs/cs42l43.c b/sound/soc/codecs/cs42l43.c
> index 47308cd870fb..1b817e1a6ea5 100644
> --- a/sound/soc/codecs/cs42l43.c
> +++ b/sound/soc/codecs/cs42l43.c
> @@ -2935,8 +2935,8 @@ static const struct dev_pm_ops cs42l43_codec_pm_ops = {
>  };
>  
>  static const struct platform_device_id cs42l43_codec_id_table[] = {
> -	{ "cs42l43-codec", },
> -	{}
> +	{ .name = "cs42l43-codec" },
> +	{ }
>  };
>  MODULE_DEVICE_TABLE(platform, cs42l43_codec_id_table);
>  
> diff --git a/sound/soc/intel/boards/sof_sdw.c b/sound/soc/intel/boards/sof_sdw.c
> index 1013e07052a3..346a7b59d8e3 100644
> --- a/sound/soc/intel/boards/sof_sdw.c
> +++ b/sound/soc/intel/boards/sof_sdw.c
> @@ -1542,8 +1542,8 @@ static void mc_remove(struct platform_device *pdev)
>  }
>  
>  static const struct platform_device_id mc_id_table[] = {
> -	{ "sof_sdw", },
> -	{}
> +	{ .name = "sof_sdw" },
> +	{ }
>  };
>  MODULE_DEVICE_TABLE(platform, mc_id_table);
>  

-- 
Péter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.