diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c index 5a65cd3..ec32cb5 100644 --- a/drivers/dahdi/wctdm24xxp/base.c +++ b/drivers/dahdi/wctdm24xxp/base.c @@ -1886,6 +1886,7 @@ static void set_ring(struct wctdm *wc, struct fxo *fxo, static void wctdm_fxo_ring_detect(struct wctdm *wc, struct wctdm_module *mod) { struct fxo *const fxo = &mod->mod.fxo; + const unsigned int NEEDED_POLARITY_CHANGES = 3; /* Look for ring status bits (Ring Detect Signal Negative and Ring * Detect Signal Positive) to transition back and forth some number of @@ -1898,7 +1899,8 @@ static void wctdm_fxo_ring_detect(struct wctdm *wc, struct wctdm_module *mod) switch (fxo->ring_state) { case DEBOUNCING_RINGING_POSITIVE: if (is_fxo_ringing_negative(fxo)) { - if (++fxo->ring_polarity_change_count > 4) { + if (++fxo->ring_polarity_change_count > + NEEDED_POLARITY_CHANGES) { mod_hooksig(wc, mod, DAHDI_RXSIG_RING); set_ring(wc, fxo, RINGING); if (debug) { @@ -1916,7 +1918,8 @@ static void wctdm_fxo_ring_detect(struct wctdm *wc, struct wctdm_module *mod) break; case DEBOUNCING_RINGING_NEGATIVE: if (is_fxo_ringing_positive(fxo)) { - if (++fxo->ring_polarity_change_count > 4) { + if (++fxo->ring_polarity_change_count > + NEEDED_POLARITY_CHANGES) { mod_hooksig(wc, mod, DAHDI_RXSIG_RING); set_ring(wc, fxo, RINGING); if (debug) {