In preparation for moving the generic DSP support out of ASoC, move
the check of dsp->running to a more appropriate place that will move
to the generic code.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20210913160057.103842-12-simont@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
        unsigned int reg;
        int i, ret;
 
+       if (!dsp->running)
+               return -EPERM;
+
        ret = cs_dsp_coeff_base_reg(ctl, ®);
        if (ret)
                return ret;
 
        mutex_lock(&cs_ctl->dsp->pwr_lock);
 
-       if (cs_ctl->enabled && cs_ctl->dsp->running)
+       if (cs_ctl->enabled)
                ret = cs_dsp_coeff_write_acked_control(cs_ctl, val);
        else
                ret = -EPERM;