From: Mike Isely Date: Sun, 25 Jun 2006 23:04:47 +0000 (-0300) Subject: V4L/DVB (4241): Fix faulty encoder error recovery in pvrusb2 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=eb8e0ee4f51a89d569c01d5b09a8cbc935c72a4c;p=openwrt%2Fstaging%2Fblogic.git V4L/DVB (4241): Fix faulty encoder error recovery in pvrusb2 Signed-off-by: Mike Isely Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index f461830c64c9..1829029cc9b9 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -1098,12 +1098,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;"