aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/cx18/cx18-io.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/video/cx18/cx18-io.h b/drivers/media/video/cx18/cx18-io.h
index e6716dcb1e8b..2635b3a8cc96 100644
--- a/drivers/media/video/cx18/cx18-io.h
+++ b/drivers/media/video/cx18/cx18-io.h
@@ -83,10 +83,14 @@ void cx18_writel_expect(struct cx18 *cx, u32 val, void __iomem *addr,
83 u32 eval, u32 mask) 83 u32 eval, u32 mask)
84{ 84{
85 int i; 85 int i;
86 u32 r;
86 eval &= mask; 87 eval &= mask;
87 for (i = 0; i < CX18_MAX_MMIO_WR_RETRIES; i++) { 88 for (i = 0; i < CX18_MAX_MMIO_WR_RETRIES; i++) {
88 cx18_writel_noretry(cx, val, addr); 89 cx18_writel_noretry(cx, val, addr);
89 if (eval == (cx18_readl(cx, addr) & mask)) 90 r = cx18_readl(cx, addr);
91 if (r == 0xffffffff && eval != 0xffffffff)
92 continue;
93 if (eval == (r & mask))
90 break; 94 break;
91 } 95 }
92} 96}