Commit 54adc0ad authored by Subhransu S. Prusty's avatar Subhransu S. Prusty Committed by Mark Brown

ASoC: Intel: move the lock and wq initialization to routine

This will be used by ACPI code as well, so moving to common routine helps
Signed-off-by: default avatarSubhransu S. Prusty <subhransu.s.prusty@intel.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 7e73e4d8
...@@ -222,6 +222,14 @@ static int sst_workqueue_init(struct intel_sst_drv *ctx) ...@@ -222,6 +222,14 @@ static int sst_workqueue_init(struct intel_sst_drv *ctx)
return 0; return 0;
} }
static void sst_init_locks(struct intel_sst_drv *ctx)
{
mutex_init(&ctx->sst_lock);
spin_lock_init(&ctx->rx_msg_lock);
spin_lock_init(&ctx->ipc_spin_lock);
spin_lock_init(&ctx->block_lock);
}
/* /*
* intel_sst_probe - PCI probe function * intel_sst_probe - PCI probe function
* *
...@@ -259,7 +267,7 @@ static int intel_sst_probe(struct pci_dev *pci, ...@@ -259,7 +267,7 @@ static int intel_sst_probe(struct pci_dev *pci,
return -EINVAL; return -EINVAL;
ops = sst_drv_ctx->ops; ops = sst_drv_ctx->ops;
mutex_init(&sst_drv_ctx->sst_lock); sst_init_locks(sst_drv_ctx);
/* pvt_id 0 reserved for async messages */ /* pvt_id 0 reserved for async messages */
sst_drv_ctx->pvt_id = 1; sst_drv_ctx->pvt_id = 1;
...@@ -270,10 +278,6 @@ static int intel_sst_probe(struct pci_dev *pci, ...@@ -270,10 +278,6 @@ static int intel_sst_probe(struct pci_dev *pci,
sst_drv_ctx->use_dma = 0; sst_drv_ctx->use_dma = 0;
sst_drv_ctx->use_lli = 0; sst_drv_ctx->use_lli = 0;
spin_lock_init(&sst_drv_ctx->ipc_spin_lock);
spin_lock_init(&sst_drv_ctx->block_lock);
spin_lock_init(&sst_drv_ctx->rx_msg_lock);
if (sst_workqueue_init(sst_drv_ctx)) if (sst_workqueue_init(sst_drv_ctx))
return -EINVAL; return -EINVAL;
......
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