mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 06:33:07 +00:00
ASoC: SOF: amd: refactor get_chip_info callback
Move get_chip_info callback to the start of API. This should be first check in probe() call. Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com> Link: https://lore.kernel.org/r/20230403071651.919027-4-Vijendar.Mukunda@amd.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
2675de62de
commit
292b544ef4
1 changed files with 5 additions and 7 deletions
|
@ -470,6 +470,11 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev)
|
|||
unsigned int addr;
|
||||
int ret;
|
||||
|
||||
chip = get_chip_info(sdev->pdata);
|
||||
if (!chip) {
|
||||
dev_err(sdev->dev, "no such device supported, chip id:%x\n", pci->device);
|
||||
return -EIO;
|
||||
}
|
||||
adata = devm_kzalloc(sdev->dev, sizeof(struct acp_dev_data),
|
||||
GFP_KERNEL);
|
||||
if (!adata)
|
||||
|
@ -486,13 +491,6 @@ int amd_sof_acp_probe(struct snd_sof_dev *sdev)
|
|||
pci_set_master(pci);
|
||||
|
||||
sdev->pdata->hw_pdata = adata;
|
||||
|
||||
chip = get_chip_info(sdev->pdata);
|
||||
if (!chip) {
|
||||
dev_err(sdev->dev, "no such device supported, chip id:%x\n", pci->device);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
adata->smn_dev = pci_get_device(PCI_VENDOR_ID_AMD, chip->host_bridge_id, NULL);
|
||||
if (!adata->smn_dev) {
|
||||
dev_err(sdev->dev, "Failed to get host bridge device\n");
|
||||
|
|
Loading…
Reference in a new issue