summaryrefslogtreecommitdiffstats
path: root/sound/soc/intel
diff options
context:
space:
mode:
authorSubhransu S. Prusty <subhransu.s.prusty@intel.com>2014-10-30 16:21:46 +0530
committerMark Brown <broonie@kernel.org>2014-10-31 16:57:27 +0000
commit54adc0ad647792b3a8557520477a40f76d99a007 (patch)
tree59164c48c64ba5c04ef22b5ebb5e2a9c4cef1b38 /sound/soc/intel
parent7e73e4d80539d0392010dfac3116307e7c9cf33d (diff)
downloadblackbird-obmc-linux-54adc0ad647792b3a8557520477a40f76d99a007.tar.gz
blackbird-obmc-linux-54adc0ad647792b3a8557520477a40f76d99a007.zip
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: Subhransu S. Prusty <subhransu.s.prusty@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel')
-rw-r--r--sound/soc/intel/sst/sst.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sound/soc/intel/sst/sst.c b/sound/soc/intel/sst/sst.c
index f9a6d6d117d6..0863471a2c86 100644
--- a/sound/soc/intel/sst/sst.c
+++ b/sound/soc/intel/sst/sst.c
@@ -222,6 +222,14 @@ static int sst_workqueue_init(struct intel_sst_drv *ctx)
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
*
@@ -259,7 +267,7 @@ static int intel_sst_probe(struct pci_dev *pci,
return -EINVAL;
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 */
sst_drv_ctx->pvt_id = 1;
@@ -270,10 +278,6 @@ static int intel_sst_probe(struct pci_dev *pci,
sst_drv_ctx->use_dma = 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))
return -EINVAL;
OpenPOWER on IntegriCloud