Commit c7a3662f authored by Vijendar Mukunda's avatar Vijendar Mukunda Committed by Mark Brown

ASoC: SOF: amd: refactor error checks in probe call

Refactor error checks code in probe() callback.
Signed-off-by: default avatarVijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230403071651.919027-5-Vijendar.Mukunda@amd.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 292b544e
...@@ -503,16 +503,12 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev) ...@@ -503,16 +503,12 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev)
if (ret < 0) { if (ret < 0) {
dev_err(sdev->dev, "failed to register IRQ %d\n", dev_err(sdev->dev, "failed to register IRQ %d\n",
sdev->ipc_irq); sdev->ipc_irq);
pci_dev_put(adata->smn_dev); goto free_smn_dev;
return ret;
} }
ret = acp_init(sdev); ret = acp_init(sdev);
if (ret < 0) { if (ret < 0)
free_irq(sdev->ipc_irq, sdev); goto free_ipc_irq;
pci_dev_put(adata->smn_dev);
return ret;
}
sdev->dsp_box.offset = 0; sdev->dsp_box.offset = 0;
sdev->dsp_box.size = BOX_SIZE_512; sdev->dsp_box.size = BOX_SIZE_512;
...@@ -528,6 +524,12 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev) ...@@ -528,6 +524,12 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev)
acp_dsp_stream_init(sdev); acp_dsp_stream_init(sdev);
return 0; return 0;
free_ipc_irq:
free_irq(sdev->ipc_irq, sdev);
free_smn_dev:
pci_dev_put(adata->smn_dev);
return ret;
} }
EXPORT_SYMBOL_NS(amd_sof_acp_probe, SND_SOC_SOF_AMD_COMMON); EXPORT_SYMBOL_NS(amd_sof_acp_probe, SND_SOC_SOF_AMD_COMMON);
......
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