SST state change should be done under sst_lock
Signed-off-by: Mythri P K <mythri.p.k@intel.com>
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>
int ret = 0;
struct intel_sst_drv *ctx = dev_get_drvdata(dev);
- mutex_lock(&ctx->sst_lock);
if (ctx->sst_state == SST_RESET) {
ret = sst_load_fw(ctx);
if (ret) {
dev_err(dev, "FW download fail %d\n", ret);
- ctx->sst_state = SST_RESET;
+ sst_set_fw_state_locked(ctx, SST_RESET);
}
}
- mutex_unlock(&ctx->sst_lock);
return ret;
}
dev_dbg(sst_drv_ctx->dev, "*** FW Init msg came***\n");
if (init->result) {
- sst_drv_ctx->sst_state = SST_RESET;
+ sst_set_fw_state_locked(sst_drv_ctx, SST_RESET);
dev_err(sst_drv_ctx->dev, "FW Init failed, Error %x\n",
init->result);
retval = init->result;