From cb977a1c8a0a1c8ea9c89da16a7514f48e20a0de Mon Sep 17 00:00:00 2001 From: Mike Isely Date: Sun, 25 Jun 2006 18:04:47 -0500 Subject: Fix faulty encoder error recovery in pvrusb2 From: Mike Isely Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'linux/drivers/media') diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 4dac7dbb5..44ee1d381 100644 --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -1099,12 +1099,13 @@ void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw, if (!hdw->flag_ok) return; msk &= PVR2_SUBSYS_ALL; + nmsk = (hdw->subsys_enabled_mask & ~msk) | (val & msk); + nmsk &= PVR2_SUBSYS_ALL; for (;;) { tryCount++; - vmsk = hdw->subsys_enabled_mask & PVR2_SUBSYS_ALL; - nmsk = (vmsk & ~msk) | (val & msk); - if (!(nmsk ^ vmsk)) break; + if (!((nmsk ^ hdw->subsys_enabled_mask) & + PVR2_SUBSYS_ALL)) break; if (tryCount > 4) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, "Too many retries when configuring device;" -- cgit v1.2.3