Commit fd979ec1 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown

ASoC: SOF: Check desc->ops directly in acpi/pci/of probe functions

We can check for the desc->ops directly in the probe functions, the ops
is not used directly in the functions.
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarRander Wang <rander.wang@intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarKai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://lore.kernel.org/r/20210521092804.3721324-2-kai.vehmanen@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent aa736700
...@@ -60,7 +60,6 @@ int sof_acpi_probe(struct platform_device *pdev, const struct sof_dev_desc *desc ...@@ -60,7 +60,6 @@ int sof_acpi_probe(struct platform_device *pdev, const struct sof_dev_desc *desc
{ {
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct snd_sof_pdata *sof_pdata; struct snd_sof_pdata *sof_pdata;
const struct snd_sof_dsp_ops *ops;
dev_dbg(dev, "ACPI DSP detected"); dev_dbg(dev, "ACPI DSP detected");
...@@ -68,9 +67,7 @@ int sof_acpi_probe(struct platform_device *pdev, const struct sof_dev_desc *desc ...@@ -68,9 +67,7 @@ int sof_acpi_probe(struct platform_device *pdev, const struct sof_dev_desc *desc
if (!sof_pdata) if (!sof_pdata)
return -ENOMEM; return -ENOMEM;
/* get ops for platform */ if (!desc->ops) {
ops = desc->ops;
if (!ops) {
dev_err(dev, "error: no matching ACPI descriptor ops\n"); dev_err(dev, "error: no matching ACPI descriptor ops\n");
return -ENODEV; return -ENODEV;
} }
......
...@@ -70,7 +70,6 @@ static int sof_of_probe(struct platform_device *pdev) ...@@ -70,7 +70,6 @@ static int sof_of_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
const struct sof_dev_desc *desc; const struct sof_dev_desc *desc;
struct snd_sof_pdata *sof_pdata; struct snd_sof_pdata *sof_pdata;
const struct snd_sof_dsp_ops *ops;
dev_info(&pdev->dev, "DT DSP detected"); dev_info(&pdev->dev, "DT DSP detected");
...@@ -82,9 +81,7 @@ static int sof_of_probe(struct platform_device *pdev) ...@@ -82,9 +81,7 @@ static int sof_of_probe(struct platform_device *pdev)
if (!desc) if (!desc)
return -ENODEV; return -ENODEV;
/* get ops for platform */ if (!desc->ops) {
ops = desc->ops;
if (!ops) {
dev_err(dev, "error: no matching DT descriptor ops\n"); dev_err(dev, "error: no matching DT descriptor ops\n");
return -ENODEV; return -ENODEV;
} }
......
...@@ -116,14 +116,11 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) ...@@ -116,14 +116,11 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
const struct sof_dev_desc *desc = const struct sof_dev_desc *desc =
(const struct sof_dev_desc *)pci_id->driver_data; (const struct sof_dev_desc *)pci_id->driver_data;
struct snd_sof_pdata *sof_pdata; struct snd_sof_pdata *sof_pdata;
const struct snd_sof_dsp_ops *ops;
int ret; int ret;
dev_dbg(&pci->dev, "PCI DSP detected"); dev_dbg(&pci->dev, "PCI DSP detected");
/* get ops for platform */ if (!desc->ops) {
ops = desc->ops;
if (!ops) {
dev_err(dev, "error: no matching PCI descriptor ops\n"); dev_err(dev, "error: no matching PCI descriptor ops\n");
return -ENODEV; return -ENODEV;
} }
......
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