From f29da850c693ee8b5e3ae112ac35fff4e9799ddc Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Thu, 23 Jan 2020 12:14:46 +0100 Subject: [PATCH] Factor slot->pstate change in slot_attach() --- sndiod/dev.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sndiod/dev.c b/sndiod/dev.c index c5e41d6..5800d61 100644 --- a/sndiod/dev.c +++ b/sndiod/dev.c @@ -1427,7 +1427,6 @@ dev_sync_attach(struct dev *d) if (!s->ops || !s->opt->mmc) continue; slot_attach(s); - s->pstate = SLOT_RUN; } d->tstate = MMC_RUN; dev_midi_full(d); @@ -1872,6 +1871,7 @@ slot_attach(struct slot *s) s->delta = startpos + pos / (int)d->round; s->delta_rem = pos % d->round; + s->pstate = SLOT_RUN; #ifdef DEBUG if (log_level >= 2) { slot_log(s); @@ -1916,10 +1916,9 @@ slot_ready(struct slot *s) */ if (s->dev->pstate == DEV_CFG) return; - if (!s->opt->mmc) { + if (!s->opt->mmc) slot_attach(s); - s->pstate = SLOT_RUN; - } else + else dev_sync_attach(s->dev); }