diff options
author | Vijendar Mukunda <Vijendar.Mukunda@amd.com> | 2023-04-03 10:16:46 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-04-03 14:15:36 +0300 |
commit | dd6bdd8b4d41b8f9db4b88dff2d10c0c62dbeb1d (patch) | |
tree | 4138b8c189bb46d1d59b02b4180b66f23bc715b5 /sound/soc/sof/amd/pci-rmb.c | |
parent | c7a3662f14d7e0add7b50dc2f971e77bebb333cc (diff) | |
download | linux-dd6bdd8b4d41b8f9db4b88dff2d10c0c62dbeb1d.tar.xz |
ASoC: SOF: amd: refactor dmic codec platform device creation
Under snd_sof_dev device scope, create platform device for dmic
codec.
Signed-off-by: Vijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/168050621098.26.7486882101201297853@mailman-core.alsa-project.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/amd/pci-rmb.c')
-rw-r--r-- | sound/soc/sof/amd/pci-rmb.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/sound/soc/sof/amd/pci-rmb.c b/sound/soc/sof/amd/pci-rmb.c index 2b84f95072d3..eaf70ea6e556 100644 --- a/sound/soc/sof/amd/pci-rmb.c +++ b/sound/soc/sof/amd/pci-rmb.c @@ -26,8 +26,6 @@ #define ACP6x_REG_START 0x1240000 #define ACP6x_REG_END 0x125C000 -static struct platform_device *dmic_dev; - static const struct sof_amd_acp_desc rembrandt_chip_info = { .rev = 6, .host_bridge_id = HOST_BRIDGE_RMB, @@ -65,32 +63,17 @@ static const struct sof_dev_desc rembrandt_desc = { static int acp_pci_rmb_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) { - struct device *dev = &pci->dev; unsigned int flag; - int ret; flag = snd_amd_acp_find_config(pci); if (flag != FLAG_AMD_SOF && flag != FLAG_AMD_SOF_ONLY_DMIC) return -ENODEV; - ret = sof_pci_probe(pci, pci_id); - if (ret != 0) - return ret; - - dmic_dev = platform_device_register_data(dev, "dmic-codec", PLATFORM_DEVID_NONE, NULL, 0); - if (IS_ERR(dmic_dev)) { - dev_err(dev, "failed to create DMIC device\n"); - sof_pci_remove(pci); - return PTR_ERR(dmic_dev); - } - return ret; + return sof_pci_probe(pci, pci_id); }; static void acp_pci_rmb_remove(struct pci_dev *pci) { - if (dmic_dev) - platform_device_unregister(dmic_dev); - sof_pci_remove(pci); } |