Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion sound/hda/hdac_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,16 @@ int snd_hdac_device_init(struct hdac_device *codec, struct hdac_bus *bus,
codec->vendor_id & 0xffff);
if (!codec->chip_name) {
err = -ENOMEM;
goto error;
goto error_chip;
}

return 0;

error_chip:
kfree(codec->vendor_name);
error:
pm_runtime_put_noidle(&codec->dev);
pm_runtime_set_suspended(&codec->dev);
put_device(&codec->dev);
return err;
}
Expand All @@ -127,6 +131,8 @@ EXPORT_SYMBOL_GPL(snd_hdac_device_init);
void snd_hdac_device_exit(struct hdac_device *codec)
{
pm_runtime_put_noidle(&codec->dev);
/* keep balance of runtime PM child_count in parent device */
pm_runtime_set_suspended(&codec->dev);
snd_hdac_bus_remove_device(codec->bus, codec);
kfree(codec->vendor_name);
kfree(codec->chip_name);
Expand Down
8 changes: 6 additions & 2 deletions sound/soc/sof/intel/hda-codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address,
if (!hdev->bus->audio_component) {
dev_dbg(sdev->dev,
"iDisp hw present but no driver\n");
return -ENOENT;
goto error;
}
hda_priv->need_display_power = true;
}
Expand All @@ -174,7 +174,7 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address,
* other return codes without modification
*/
if (ret == 0)
ret = -ENOENT;
goto error;
}

return ret;
Expand All @@ -187,6 +187,10 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address,

return ret;
#endif

error:
snd_hdac_ext_bus_device_exit(hdev);
return -ENOENT;
}

/* Codec initialization */
Expand Down