ALSA: hda/tas2781: leave hda_component in usable state
[platform/kernel/linux-starfive.git] / sound / pci / hda / tas2781_hda_i2c.c
index fb80280..b428371 100644 (file)
@@ -612,9 +612,13 @@ static void tas2781_hda_unbind(struct device *dev,
 {
        struct tasdevice_priv *tas_priv = dev_get_drvdata(dev);
        struct hda_component *comps = master_data;
+       comps = &comps[tas_priv->index];
 
-       if (comps[tas_priv->index].dev == dev)
-               memset(&comps[tas_priv->index], 0, sizeof(*comps));
+       if (comps->dev == dev) {
+               comps->dev = NULL;
+               memset(comps->name, 0, sizeof(comps->name));
+               comps->playback_hook = NULL;
+       }
 
        tasdevice_config_info_remove(tas_priv);
        tasdevice_dsp_remove(tas_priv);