Skip to contentSkip to conversation

ASoC: intel/boards: add missing MODULE_DEVICE_TABLE

PATCH In review Zou Wei 3 participants 5 messages May 12, 2021 – May 14, 2021

Subsystems (3)
lore
Share & tools
lore

Zou Wei

author
#0 lore raw

PATCH 1/1 ASoC: intel/boards: add missing MODULE_DEVICE_TABLE

This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this driver when it is built as an external module.

---
 sound/soc/intel/boards/sof_da7219_max98373.c | 1 +
 sound/soc/intel/boards/sof_rt5682.c          | 1 +
 2 files changed, 2 insertions(+)
sound/soc/intel/boards/sof_da7219_max98373.c +1 -0
index f3cb077..8d1ad89 100644
@@ -440,6 +440,7 @@ static const struct platform_device_id board_ids[] = {
 	},
 	{ }
 };
+MODULE_DEVICE_TABLE(platform, board_ids);
 
 static struct platform_driver audio = {
 	.probe = audio_probe,
sound/soc/intel/boards/sof_rt5682.c +1 -0
index 58548ea..cf1d053 100644
@@ -968,6 +968,7 @@ static const struct platform_device_id board_ids[] = {
 	},
 	{ }
 };
+MODULE_DEVICE_TABLE(platform, board_ids);
 
 static struct platform_driver sof_audio = {
 	.probe = sof_audio_probe,
Signature · 1 line
2.6.2
#1 lore raw
Quoted 3 lines · Zou Wei

This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this driver when it is built as an external module.

I have a limited understanding of all this, but we already support the machine drivers as modules and things work fine.

I wonder if this MODULE_DEVICE_TABLE generates the alias automatically, which would make the existing ones added manually at the end of the files unnecessary? If that was the case, then we should remove those MODULE_ALIAS as well, no?

MODULE_DESCRIPTION("SOF Audio Machine driver"); MODULE_AUTHOR("Bard Liao <[email protected]>"); MODULE_AUTHOR("Sathya Prakash M R <[email protected]>"); MODULE_AUTHOR("Brent Lu <[email protected]>"); MODULE_LICENSE("GPL v2"); MODULE_ALIAS("platform:sof_rt5682"); MODULE_ALIAS("platform:tgl_max98357a_rt5682"); MODULE_ALIAS("platform:jsl_rt5682_rt1015"); MODULE_ALIAS("platform:tgl_max98373_rt5682"); MODULE_ALIAS("platform:jsl_rt5682_max98360a"); MODULE_ALIAS("platform:cml_rt1015_rt5682"); MODULE_ALIAS("platform:tgl_rt1011_rt5682"); MODULE_ALIAS("platform:jsl_rt5682_rt1015p");

Quoted 33 lines
---
  sound/soc/intel/boards/sof_da7219_max98373.c | 1 +
  sound/soc/intel/boards/sof_rt5682.c          | 1 +
  2 files changed, 2 insertions(+)
sound/soc/intel/boards/sof_da7219_max98373.c +1 -0
index f3cb077..8d1ad89 100644
@@ -440,6 +440,7 @@ static const struct platform_device_id board_ids[] = {
  	},
  	{ }
  };
+MODULE_DEVICE_TABLE(platform, board_ids);
 
  static struct platform_driver audio = {
  	.probe = audio_probe,
sound/soc/intel/boards/sof_rt5682.c +1 -0
index 58548ea..cf1d053 100644
@@ -968,6 +968,7 @@ static const struct platform_device_id board_ids[] = {
  	},
  	{ }
  };
+MODULE_DEVICE_TABLE(platform, board_ids);
 
  static struct platform_driver sof_audio = {
  	.probe = sof_audio_probe,
maintainer
#2 lore raw
Quoted 4 lines · Pierre-Louis Bossart

I wonder if this MODULE_DEVICE_TABLE generates the alias automatically, which would make the existing ones added manually at the end of the files unnecessary? If that was the case, then we should remove those MODULE_ALIAS as well, no?

Yes, you shouldn't need the MODULE_ALIAS stuff there.

#3 lore raw
Quoted 8 lines
Quoted 6 lines

I wonder if this MODULE_DEVICE_TABLE generates the alias automatically, which would make the existing ones added manually at the end of the files unnecessary? If that was the case, then we should remove those MODULE_ALIAS as well, no?

Yes, you shouldn't need the MODULE_ALIAS stuff there.

ok, if that's alright with everyone I'll send a larger patchset that correct this for all machine drivers, and add the following two tags to give proper credits to the reporters.

maintainer
#4 lore raw
In reply to Zou Wei
Quoted 3 lines · Zou Wei

This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this driver when it is built as an external module.

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: intel/boards: add missing MODULE_DEVICE_TABLE

      commit: a75e5cdf4dd1307bb1541edbb0c008f40896644c

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark