Skip to content

Commit 99b0f05

Browse files
committed
escc: re-use escc_reset_chn() for soft reset
This removes duplication of the internal device state initialisation between device reset and soft reset. Signed-off-by: Mark Cave-Ayland <[email protected]> Reviewed-by: Peter Maydell <[email protected]> Message-Id: <[email protected]> Signed-off-by: Mark Cave-Ayland <[email protected]>
1 parent a04ca92 commit 99b0f05

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

hw/char/escc.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ static void escc_reset_chn(ESCCChannelState *s)
288288

289289
static void escc_soft_reset_chn(ESCCChannelState *s)
290290
{
291-
s->reg = 0;
291+
escc_reset_chn(s);
292+
292293
s->wregs[W_CMD] = 0;
293294
s->wregs[W_INTR] &= INTR_PAR_SPEC | INTR_WTRQ_TXRX;
294295
s->wregs[W_RXCTRL] &= ~RXCTRL_RXEN;
@@ -314,12 +315,6 @@ static void escc_soft_reset_chn(ESCCChannelState *s)
314315
s->rregs[R_SPEC] |= SPEC_BITS8;
315316
s->rregs[R_INTR] = 0;
316317
s->rregs[R_MISC] &= MISC_2CLKMISS;
317-
318-
s->rx = s->tx = 0;
319-
s->rxint = s->txint = 0;
320-
s->rxint_under_svc = s->txint_under_svc = 0;
321-
s->e0_mode = s->led_mode = s->caps_lock_mode = s->num_lock_mode = 0;
322-
clear_queue(s);
323318
}
324319

325320
static void escc_hard_reset_chn(ESCCChannelState *s)

0 commit comments

Comments
 (0)