mirror of
https://github.com/torvalds/linux.git
synced 2024-11-23 12:42:02 +00:00
Merge series "ASoC: SOF: simplify probe and report errors" from Ranjani Sridharan <ranjani.sridharan@linux.intel.com>:
These patches simplify the sof_probe_complete handling and address reporting of errors during probe. Peter Ujfalusi (2): ASoC: SOF: core: Add missing error prints to device probe operation ASoC: SOF: Simplify sof_probe_complete handling for acpi/pci/of sound/soc/sof/core.c | 9 +++++++-- sound/soc/sof/sof-acpi-dev.c | 18 +++--------------- sound/soc/sof/sof-of-dev.c | 18 +++--------------- sound/soc/sof/sof-pci-dev.c | 20 ++++---------------- 4 files changed, 17 insertions(+), 48 deletions(-) -- 2.25.1
This commit is contained in:
commit
2976eef29e
@ -232,8 +232,11 @@ static int sof_probe_continue(struct snd_sof_dev *sdev)
|
||||
}
|
||||
|
||||
ret = snd_sof_machine_register(sdev, plat_data);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
dev_err(sdev->dev,
|
||||
"error: failed to register machine driver %d\n", ret);
|
||||
goto fw_trace_err;
|
||||
}
|
||||
|
||||
/*
|
||||
* Some platforms in SOF, ex: BYT, may not have their platform PM
|
||||
@ -309,8 +312,10 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)
|
||||
!sof_ops(sdev)->block_read || !sof_ops(sdev)->block_write ||
|
||||
!sof_ops(sdev)->send_msg || !sof_ops(sdev)->load_firmware ||
|
||||
!sof_ops(sdev)->ipc_msg_data || !sof_ops(sdev)->ipc_pcm_params ||
|
||||
!sof_ops(sdev)->fw_ready)
|
||||
!sof_ops(sdev)->fw_ready) {
|
||||
dev_err(dev, "error: missing mandatory ops\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
INIT_LIST_HEAD(&sdev->pcm_list);
|
||||
INIT_LIST_HEAD(&sdev->kcontrol_list);
|
||||
|
@ -61,7 +61,6 @@ int sof_acpi_probe(struct platform_device *pdev, const struct sof_dev_desc *desc
|
||||
struct device *dev = &pdev->dev;
|
||||
struct snd_sof_pdata *sof_pdata;
|
||||
const struct snd_sof_dsp_ops *ops;
|
||||
int ret;
|
||||
|
||||
dev_dbg(dev, "ACPI DSP detected");
|
||||
|
||||
@ -93,22 +92,11 @@ int sof_acpi_probe(struct platform_device *pdev, const struct sof_dev_desc *desc
|
||||
sof_pdata->tplg_filename_prefix =
|
||||
sof_pdata->desc->default_tplg_path;
|
||||
|
||||
#if IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE)
|
||||
/* set callback to enable runtime_pm */
|
||||
/* set callback to be called on successful device probe to enable runtime_pm */
|
||||
sof_pdata->sof_probe_complete = sof_acpi_probe_complete;
|
||||
#endif
|
||||
|
||||
/* call sof helper for DSP hardware probe */
|
||||
ret = snd_sof_device_probe(dev, sof_pdata);
|
||||
if (ret) {
|
||||
dev_err(dev, "error: failed to probe DSP hardware!\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if !IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE)
|
||||
sof_acpi_probe_complete(dev);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
return snd_sof_device_probe(dev, sof_pdata);
|
||||
}
|
||||
EXPORT_SYMBOL_NS(sof_acpi_probe, SND_SOC_SOF_ACPI_DEV);
|
||||
|
||||
|
@ -71,7 +71,6 @@ static int sof_of_probe(struct platform_device *pdev)
|
||||
const struct sof_dev_desc *desc;
|
||||
struct snd_sof_pdata *sof_pdata;
|
||||
const struct snd_sof_dsp_ops *ops;
|
||||
int ret;
|
||||
|
||||
dev_info(&pdev->dev, "DT DSP detected");
|
||||
|
||||
@ -98,22 +97,11 @@ static int sof_of_probe(struct platform_device *pdev)
|
||||
sof_pdata->fw_filename_prefix = sof_pdata->desc->default_fw_path;
|
||||
sof_pdata->tplg_filename_prefix = sof_pdata->desc->default_tplg_path;
|
||||
|
||||
#if IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE)
|
||||
/* set callback to enable runtime_pm */
|
||||
/* set callback to be called on successful device probe to enable runtime_pm */
|
||||
sof_pdata->sof_probe_complete = sof_of_probe_complete;
|
||||
#endif
|
||||
/* call sof helper for DSP hardware probe */
|
||||
ret = snd_sof_device_probe(dev, sof_pdata);
|
||||
if (ret) {
|
||||
dev_err(dev, "error: failed to probe DSP hardware\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if !IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE)
|
||||
sof_of_probe_complete(dev);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
/* call sof helper for DSP hardware probe */
|
||||
return snd_sof_device_probe(dev, sof_pdata);
|
||||
}
|
||||
|
||||
static int sof_of_remove(struct platform_device *pdev)
|
||||
|
@ -184,25 +184,13 @@ int sof_pci_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
|
||||
if (sof_override_tplg_name)
|
||||
sof_pdata->tplg_filename = sof_override_tplg_name;
|
||||
|
||||
#if IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE)
|
||||
/* set callback to enable runtime_pm */
|
||||
/* set callback to be called on successful device probe to enable runtime_pm */
|
||||
sof_pdata->sof_probe_complete = sof_pci_probe_complete;
|
||||
#endif
|
||||
|
||||
/* call sof helper for DSP hardware probe */
|
||||
ret = snd_sof_device_probe(dev, sof_pdata);
|
||||
if (ret) {
|
||||
dev_err(dev, "error: failed to probe DSP hardware!\n");
|
||||
goto release_regions;
|
||||
}
|
||||
|
||||
#if !IS_ENABLED(CONFIG_SND_SOC_SOF_PROBE_WORK_QUEUE)
|
||||
sof_pci_probe_complete(dev);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
|
||||
release_regions:
|
||||
pci_release_regions(pci);
|
||||
if (ret)
|
||||
pci_release_regions(pci);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user