Commit 8a5b0177 authored by Amadeusz Sławiński's avatar Amadeusz Sławiński Committed by Mark Brown

ALSA: hdac: Fix codec name after machine driver is unloaded and reloaded

Currently on each driver reload internal counter is being increased. It
causes failure to enumerate driver devices, as they have hardcoded:
.codec_name = "ehdaudio0D2",
As there is currently no devices with multiple hda codecs and there is
currently no established way to reliably differentiate, between them,
always assign bus->idx = 0;

This fixes a problem when we unload and reload machine driver idx gets
incremented, so .codec_name would've needed to be set to "ehdaudio1D2"
after first reload and so on.
Signed-off-by: default avatarAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Acked-by: default avatarTakashi Iwai <tiwai@suse.de>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 776cb3b8
...@@ -93,7 +93,6 @@ int snd_hdac_ext_bus_init(struct hdac_bus *bus, struct device *dev, ...@@ -93,7 +93,6 @@ int snd_hdac_ext_bus_init(struct hdac_bus *bus, struct device *dev,
const struct hdac_ext_bus_ops *ext_ops) const struct hdac_ext_bus_ops *ext_ops)
{ {
int ret; int ret;
static int idx;
/* check if io ops are provided, if not load the defaults */ /* check if io ops are provided, if not load the defaults */
if (io_ops == NULL) if (io_ops == NULL)
...@@ -104,7 +103,12 @@ int snd_hdac_ext_bus_init(struct hdac_bus *bus, struct device *dev, ...@@ -104,7 +103,12 @@ int snd_hdac_ext_bus_init(struct hdac_bus *bus, struct device *dev,
return ret; return ret;
bus->ext_ops = ext_ops; bus->ext_ops = ext_ops;
bus->idx = idx++; /* FIXME:
* Currently only one bus is supported, if there is device with more
* buses, bus->idx should be greater than 0, but there needs to be a
* reliable way to always assign same number.
*/
bus->idx = 0;
bus->cmd_dma_state = true; bus->cmd_dma_state = true;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment