Unverified Commit b19671d6 authored by Tzung-Bi Shih's avatar Tzung-Bi Shih Committed by Mark Brown
Browse files

ASoC: core: use component driver name as component name



fmt_single_name() uses device name to determine component name.  If
multiple components bind to the same device, the debugfs creation in
soc_init_component_debugfs() would fail due to duplicated entity
names.

Name provided by component driver is unique enough to represent each
component.  Use component driver name as the component name to avoid
name duplication.

Signed-off-by: default avatarTzung-Bi Shih <tzungbi@google.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7cda6223
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -3106,6 +3106,9 @@ static int snd_soc_component_initialize(struct snd_soc_component *component,
{
	struct snd_soc_dapm_context *dapm;

	if (driver->name)
		component->name = kstrdup(driver->name, GFP_KERNEL);
	else
		component->name = fmt_single_name(dev, &component->id);
	if (!component->name) {
		dev_err(dev, "ASoC: Failed to allocate name\n");