[PATCH 15/16] ALSA: hda/tas2781: reset the amp before component_add

Gergo Koteles
2023-12-07T00:05:16Z

Prevent race to make the init reliable.

Signed-off-by: Gergo Koteles <soyer@irl.hu>
---
sound/pci/hda/tas2781_hda_i2c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/pci/hda/tas2781_hda_i2c.c b/sound/pci/hda/tas2781_hda_i2c.c
index cb8872e15bb0..f72e0beab1fb 100644
--- a/sound/pci/hda/tas2781_hda_i2c.c
+++ b/sound/pci/hda/tas2781_hda_i2c.c
@@ -800,14 +800,14 @@ static int tas2781_hda_i2c_probe(struct i2c_client *clt)

pm_runtime_put_autosuspend(tas_hda->dev);

+ tas2781_reset(tas_hda->priv);
+
ret = component_add(tas_hda->dev, &tas2781_hda_comp_ops);
if (ret) {
dev_err(tas_hda->dev, "Register component failed: %d\n", ret);
pm_runtime_disable(tas_hda->dev);
goto err;
}
-
- tas2781_reset(tas_hda->priv);
err:
if (ret)
tas2781_hda_remove(&clt->dev);
--
2.43.0