Audio : Fix wrong usuage of takesem
Fix to use take sem before I2S_STOP
@@ -956,6 +956,7 @@ static int alc5658_stop(FAR struct audio_lowerhalf_s *dev)
if (!priv) {
return -EINVAL;
}
+ alc5658_takesem(&priv->devsem);
if (priv->inout) {
I2S_STOP(priv->i2s, I2S_RX);
@@ -966,7 +967,6 @@ static int alc5658_stop(FAR struct audio_lowerhalf_s *dev)
/* Need to run the stop script here */
alc5658_exec_i2c_script(priv, codec_stop_script, sizeof(codec_stop_script) / sizeof(t_codec_init_script_entry));
- alc5658_takesem(&priv->devsem);
priv->running = false;
alc5658_givesem(&priv->devsem);
