aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/common
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2015-02-20 13:12:54 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-03-03 09:15:42 -0500
commitf35593fdc8851aa28f6949bd48fe90653d383017 (patch)
tree3a531488b29fbd73f4527528633892f81a8013ef /drivers/media/common
parent809abdbf46377abe39a72884d026979bb1dbd6d3 (diff)
[media] saa7146: replace current->state by set_current_state()
Use helper functions to access current->state. Direct assignments are prone to races and therefore buggy. current->state = TASK_RUNNING can be replaced by __set_current_state() Thanks to Peter Zijlstra for the exact definition of the problem. Suggested-By: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/common')
-rw-r--r--drivers/media/common/saa7146/saa7146_vbi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/common/saa7146/saa7146_vbi.c b/drivers/media/common/saa7146/saa7146_vbi.c
index 1e71e374bbfe..2da995758778 100644
--- a/drivers/media/common/saa7146/saa7146_vbi.c
+++ b/drivers/media/common/saa7146/saa7146_vbi.c
@@ -95,7 +95,7 @@ static int vbi_workaround(struct saa7146_dev *dev)
95 95
96 /* prepare to wait to be woken up by the irq-handler */ 96 /* prepare to wait to be woken up by the irq-handler */
97 add_wait_queue(&vv->vbi_wq, &wait); 97 add_wait_queue(&vv->vbi_wq, &wait);
98 current->state = TASK_INTERRUPTIBLE; 98 set_current_state(TASK_INTERRUPTIBLE);
99 99
100 /* start rps1 to enable workaround */ 100 /* start rps1 to enable workaround */
101 saa7146_write(dev, RPS_ADDR1, dev->d_rps1.dma_handle); 101 saa7146_write(dev, RPS_ADDR1, dev->d_rps1.dma_handle);
@@ -106,7 +106,7 @@ static int vbi_workaround(struct saa7146_dev *dev)
106 DEB_VBI("brs bug workaround %d/1\n", i); 106 DEB_VBI("brs bug workaround %d/1\n", i);
107 107
108 remove_wait_queue(&vv->vbi_wq, &wait); 108 remove_wait_queue(&vv->vbi_wq, &wait);
109 current->state = TASK_RUNNING; 109 __set_current_state(TASK_RUNNING);
110 110
111 /* disable rps1 irqs */ 111 /* disable rps1 irqs */
112 SAA7146_IER_DISABLE(dev,MASK_28); 112 SAA7146_IER_DISABLE(dev,MASK_28);