diff options
author | Subhransu S. Prusty <subhransu.s.prusty@intel.com> | 2014-10-30 06:51:46 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-10-31 12:57:27 -0400 |
commit | 54adc0ad647792b3a8557520477a40f76d99a007 (patch) | |
tree | 59164c48c64ba5c04ef22b5ebb5e2a9c4cef1b38 | |
parent | 7e73e4d80539d0392010dfac3116307e7c9cf33d (diff) |
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>
-rw-r--r-- | sound/soc/intel/sst/sst.c | 14 |
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) | |||
222 | return 0; | 222 | return 0; |
223 | } | 223 | } |
224 | 224 | ||
225 | static void sst_init_locks(struct intel_sst_drv *ctx) | ||
226 | { | ||
227 | mutex_init(&ctx->sst_lock); | ||
228 | spin_lock_init(&ctx->rx_msg_lock); | ||
229 | spin_lock_init(&ctx->ipc_spin_lock); | ||
230 | spin_lock_init(&ctx->block_lock); | ||
231 | } | ||
232 | |||
225 | /* | 233 | /* |
226 | * intel_sst_probe - PCI probe function | 234 | * intel_sst_probe - PCI probe function |
227 | * | 235 | * |
@@ -259,7 +267,7 @@ static int intel_sst_probe(struct pci_dev *pci, | |||
259 | return -EINVAL; | 267 | return -EINVAL; |
260 | 268 | ||
261 | ops = sst_drv_ctx->ops; | 269 | ops = sst_drv_ctx->ops; |
262 | mutex_init(&sst_drv_ctx->sst_lock); | 270 | sst_init_locks(sst_drv_ctx); |
263 | 271 | ||
264 | /* pvt_id 0 reserved for async messages */ | 272 | /* pvt_id 0 reserved for async messages */ |
265 | sst_drv_ctx->pvt_id = 1; | 273 | sst_drv_ctx->pvt_id = 1; |
@@ -270,10 +278,6 @@ static int intel_sst_probe(struct pci_dev *pci, | |||
270 | sst_drv_ctx->use_dma = 0; | 278 | sst_drv_ctx->use_dma = 0; |
271 | sst_drv_ctx->use_lli = 0; | 279 | sst_drv_ctx->use_lli = 0; |
272 | 280 | ||
273 | spin_lock_init(&sst_drv_ctx->ipc_spin_lock); | ||
274 | spin_lock_init(&sst_drv_ctx->block_lock); | ||
275 | spin_lock_init(&sst_drv_ctx->rx_msg_lock); | ||
276 | |||
277 | if (sst_workqueue_init(sst_drv_ctx)) | 281 | if (sst_workqueue_init(sst_drv_ctx)) |
278 | return -EINVAL; | 282 | return -EINVAL; |
279 | 283 | ||