summary refs log tree commit diff
path: root/sound
diff options
context:
space:
mode:
authorVijendar Mukunda <Vijendar.Mukunda@amd.com>2023-04-03 12:46:44 +0530
committerPrasad Prasad <venkataprasad.potturu@amd.com>2023-04-23 15:08:14 -0400
commit6cd9cf61720821607c470d2dfce6f3f459edb424 (patch)
treeaad74d6da920f5428ba9aa26a4a8eb1ccce63916 /sound
parent6b8960ef19fd7c98d0b25bbdce2fb60ac3bcbb0b (diff)
downloadlinux-6cd9cf61720821607c470d2dfce6f3f459edb424.tar.gz
FROMGIT: 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>
(cherry picked from commit 292b544ef4555ec5c69522e9c6eace6a90c4cd00
 https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git/ for-next)

Signed-off-by: Venkata Prasad Potturu <venkataprasad.potturu@amd.com>
Reviewed-by: V sujith kumar Reddy <Vsujithkumar.Reddy@amd.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/sof/amd/acp.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sound/soc/sof/amd/acp.c b/sound/soc/sof/amd/acp.c
index d5ccd4d09278..e8fe324c23d0 100644
--- a/sound/soc/sof/amd/acp.c
+++ b/sound/soc/sof/amd/acp.c
@@ -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");