@@ -552,13 +552,13 @@ int bxt_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
struct sst_dsp *sst;
int ret;
- ret = skl_sst_ctx_init(dev, irq, fw_name, dsp, &skl_dev);
+ skl = *dsp;
+ ret = skl_sst_ctx_init(skl, fw_name, &skl_dev);
if (ret < 0) {
dev_err(dev, "%s: no device\n", __func__);
return ret;
}
- skl = *dsp;
sst = skl->dsp;
sst->fw_ops = bxt_fw_ops;
sst->addr.lpe = mmio_base;
@@ -429,13 +429,13 @@ int cnl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
struct sst_dsp *sst;
int ret;
- ret = skl_sst_ctx_init(dev, irq, fw_name, dsp, &cnl_dev);
+ cnl = *dsp;
+ ret = skl_sst_ctx_init(cnl, fw_name, &cnl_dev);
if (ret < 0) {
dev_err(dev, "%s: no device\n", __func__);
return ret;
}
- cnl = *dsp;
sst = cnl->dsp;
sst->fw_ops = cnl_fw_ops;
sst->addr.lpe = mmio_base;
@@ -225,8 +225,7 @@ int skl_dsp_strip_extended_manifest(struct firmware *fw);
void skl_dsp_set_astate_cfg(struct skl_dev *skl, u32 cnt, void *data);
-int skl_sst_ctx_init(struct device *dev, int irq, const char *fw_name,
- struct skl_dev **dsp,
+int skl_sst_ctx_init(struct skl_dev *skl, const char *fw_name,
struct sst_pdata *pdata);
int skl_prepare_lib_load(struct skl_dev *skl, struct skl_lib_info *linfo,
struct firmware *stripped_fw,
@@ -354,30 +354,26 @@ int skl_dsp_strip_extended_manifest(struct firmware *fw)
return 0;
}
-int skl_sst_ctx_init(struct device *dev, int irq, const char *fw_name,
- struct skl_dev **dsp,
+int skl_sst_ctx_init(struct skl_dev *skl, const char *fw_name,
struct sst_pdata *pdata)
{
- struct skl_dev *skl = *dsp;
struct sst_dsp *sst;
+ struct device *dev = skl->dev;
pdata->id = skl->pci->device;
- pdata->irq = irq;
+ pdata->irq = skl->pci->irq;
pdata->dma_base = -1;
- skl->dev = dev;
pdata->dsp = skl;
INIT_LIST_HEAD(&skl->uuid_list);
- skl->dsp = sst_dsp_new(dev, pdata);
- if (!skl->dsp) {
- dev_err(skl->dev, "%s: no device\n", __func__);
+ sst = sst_dsp_new(dev, pdata);
+ if (!sst) {
+ dev_err(dev, "%s: no device\n", __func__);
return -ENODEV;
}
- sst = skl->dsp;
+ skl->dsp = sst;
sst->fw_name = fw_name;
init_waitqueue_head(&skl->mod_load_wait);
- INIT_LIST_HEAD(&sst->module_list);
-
skl->is_first_boot = true;
return 0;
@@ -523,13 +523,13 @@ int skl_sst_dsp_init(struct device *dev, void __iomem *mmio_base, int irq,
struct sst_dsp *sst;
int ret;
- ret = skl_sst_ctx_init(dev, irq, fw_name, dsp, &skl_dev);
+ skl = *dsp;
+ ret = skl_sst_ctx_init(skl, fw_name, &skl_dev);
if (ret < 0) {
dev_err(dev, "%s: no device\n", __func__);
return ret;
}
- skl = *dsp;
sst = skl->dsp;
sst->addr.lpe = mmio_base;
sst->addr.shim = mmio_base;
@@ -890,6 +890,7 @@ static int skl_create(struct pci_dev *pci,
snd_hdac_ext_bus_init(bus, &pci->dev, &bus_core_ops, ext_ops);
bus->use_posbuf = 1;
skl->pci = pci;
+ skl->dev = &pci->dev;
INIT_WORK(&skl->probe_work, skl_probe_work);
bus->bdl_pos_adj = 0;
'irq' and 'dsp' are redundant parameters of skl_sst_ctx_init. Simplify its declaration and update each invokes. This yet another step In quest for simplification of Skylake initialization process. Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> --- sound/soc/intel/skylake/bxt-sst.c | 4 ++-- sound/soc/intel/skylake/cnl-sst.c | 4 ++-- sound/soc/intel/skylake/skl-sst-dsp.h | 3 +-- sound/soc/intel/skylake/skl-sst-utils.c | 18 +++++++----------- sound/soc/intel/skylake/skl-sst.c | 4 ++-- sound/soc/intel/skylake/skl.c | 1 + 6 files changed, 15 insertions(+), 19 deletions(-)