Skip to content

Commit

Permalink
video: pxa3xx-gcu: Simplify the logic to exit while loop in pxa3xx_gc…
Browse files Browse the repository at this point in the history
…u_wait_idle

If wait_event_interruptible_timeout returns a positive value, it means
the condition evaluated is true. Which means priv->shared->hw_running is false.
And then we will exit the loop.

This patch simplifies the logic to exit the while loop.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
  • Loading branch information
Axel Lin authored and Florian Tobias Schandinat committed Apr 9, 2012
1 parent 79d3c41 commit 688ec34
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/video/pxa3xx-gcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,9 @@ pxa3xx_gcu_wait_idle(struct pxa3xx_gcu_priv *priv)
ret = wait_event_interruptible_timeout(priv->wait_idle,
!priv->shared->hw_running, HZ*4);

if (ret < 0)
if (ret != 0)
break;

if (ret > 0)
continue;

if (gc_readl(priv, REG_GCRBEXHR) == rbexhr &&
priv->shared->num_interrupts == num) {
QERROR("TIMEOUT");
Expand Down

0 comments on commit 688ec34

Please sign in to comment.