[09/11] Correct wait_event_timeout error return check.

Message ID 1333295631-31866-9-git-send-email-sgunderson@bigfoot.com (mailing list archive)
State Changes Requested, archived
Headers

Commit Message

Steinar H. Gunderson April 1, 2012, 3:53 p.m. UTC
  From: "Steinar H. Gunderson" <sesse@samfundet.no>

wait_event_timeout() returns 0 on timeout, not -ERESTARTSYS.
Note that since this actually causes timeouts to be handled,
it makes the CA situation a lot worse without the next patch
in the series.
---
 drivers/media/dvb/mantis/mantis_hif.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/media/dvb/mantis/mantis_hif.c b/drivers/media/dvb/mantis/mantis_hif.c
index 6d42f73..a3ec2a2 100644
--- a/drivers/media/dvb/mantis/mantis_hif.c
+++ b/drivers/media/dvb/mantis/mantis_hif.c
@@ -47,7 +47,7 @@  static int mantis_hif_sbuf_opdone_wait(struct mantis_ca *ca)
 
 	if (wait_event_timeout(ca->hif_opdone_wq,
 			       test_and_clear_bit(MANTIS_SBUF_OPDONE_BIT, &ca->hif_event),
-			       msecs_to_jiffies(500)) == -ERESTARTSYS) {
+			       msecs_to_jiffies(500)) == 0) {
 
 		dprintk(MANTIS_ERROR, 1, "Adapter(%d) Slot(0): Smart buffer operation timeout !", mantis->num);
 		rc = -EREMOTEIO;
@@ -63,7 +63,7 @@  static int mantis_hif_write_wait(struct mantis_ca *ca)
 
 	if (wait_event_timeout(ca->hif_write_wq,
 			       test_and_clear_bit(MANTIS_GPIF_WRACK_BIT, &mantis->gpif_status),
-			       msecs_to_jiffies(500)) == -ERESTARTSYS) {
+			       msecs_to_jiffies(500)) == 0) {
 
 		dprintk(MANTIS_ERROR, 1, "Adapter(%d) Slot(0): Write ACK timed out !", mantis->num);
 		rc = -EREMOTEIO;