linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] ASoC: soc-core: Prevent warning if no DMI table is present
@ 2021-03-03 11:55 Jon Hunter
  2021-03-04  0:54 ` Mark Brown
  2021-03-09 19:41 ` Pierre-Louis Bossart
  0 siblings, 2 replies; 15+ messages in thread
From: Jon Hunter @ 2021-03-03 11:55 UTC (permalink / raw)
  To: Liam Girdwood, Mark Brown, Takashi Iwai
  Cc: alsa-devel, linux-kernel, linux-tegra, Jon Hunter

Many systems do not use ACPI and hence do not provide a DMI table. On
non-ACPI systems a warning, such as the following, is printed on boot.

 WARNING KERN tegra-audio-graph-card sound: ASoC: no DMI vendor name!

The variable 'dmi_available' is not exported and so currently cannot be
used by kernel modules without adding an accessor. However, it is
possible to use the function is_acpi_device_node() to determine if the
sound card is an ACPI device and hence indicate if we expect a DMI table
to be present. Therefore, call is_acpi_device_node() to see if we are
using ACPI and only parse the DMI table if we are booting with ACPI.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
Changes since V1:
- Use is_acpi_device_node() to determine if we expect the DMI table to
  be present.

 sound/soc/soc-core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index f6d4e99b590c..0cffc9527e28 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -31,6 +31,7 @@
 #include <linux/of.h>
 #include <linux/of_graph.h>
 #include <linux/dmi.h>
+#include <linux/acpi.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
 #include <sound/pcm_params.h>
@@ -1573,6 +1574,9 @@ int snd_soc_set_dmi_name(struct snd_soc_card *card, const char *flavour)
 	if (card->long_name)
 		return 0; /* long name already set by driver or from DMI */
 
+	if (!is_acpi_device_node(card->dev->fwnode))
+		return 0;
+
 	/* make up dmi long name as: vendor-product-version-board */
 	vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
 	if (!vendor || !is_dmi_valid(vendor)) {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2021-03-10 20:18 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03 11:55 [PATCH V2] ASoC: soc-core: Prevent warning if no DMI table is present Jon Hunter
2021-03-04  0:54 ` Mark Brown
2021-03-09 19:41 ` Pierre-Louis Bossart
2021-03-10 13:35   ` Mark Brown
2021-03-10 15:44     ` Pierre-Louis Bossart
2021-03-10 16:18       ` Mark Brown
2021-03-10 16:37         ` Takashi Iwai
2021-03-10 16:41           ` Pierre-Louis Bossart
2021-03-10 16:52             ` Mark Brown
2021-03-10 17:50               ` Pierre-Louis Bossart
2021-03-10 18:16                 ` Mark Brown
2021-03-10 18:37                   ` Pierre-Louis Bossart
2021-03-10 19:17                     ` Jon Hunter
2021-03-10 20:16                       ` Mark Brown
2021-03-10 16:50           ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).