Skip to contentSkip to conversation

17/34: cris/eeprom: replace interruptible_sleep_on()

PATCH New Nishanth Aravamudan 1 participant 1 message Jan 25, 2005 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 17/34: cris/eeprom: replace interruptible_sleep_on()

Hi,

Please consider applying.

Description: Use wait_event_interruptible() instead of the deprecated interruptible_sleep_on(). The replacements were both straight-forward as the sleeps were conditionally-looped. Patch is compile-tested.

arch/cris/arch-v10/drivers/eeprom.c +8 -16
@@ -94,6 +94,7 @@
 #include <linux/init.h>
 #include <linux/delay.h>
 #include <linux/interrupt.h>
+#include <linux/wait.h>
 #include <asm/uaccess.h>
 #include "i2c.h"
 
@@ -526,15 +527,9 @@ static ssize_t eeprom_read(struct file *
     return -EFAULT;
   }
   
-  while(eeprom.busy)
-  {
-    interruptible_sleep_on(&eeprom.wait_q);
-
-    /* bail out if we get interrupted */
-    if (signal_pending(current))
-      return -EINTR;
-    
-  }
+  wait_event_interruptible(eeprom.wait_q, !eeprom.busy);
+  if (signal_pending(current))
+    return -EINTR;
   eeprom.busy++;
 
   page = (unsigned char) (p >> 8);
@@ -604,13 +599,10 @@ static ssize_t eeprom_write(struct file 
     return -EFAULT;
   }
 
-  while(eeprom.busy)
-  {
-    interruptible_sleep_on(&eeprom.wait_q);
-    /* bail out if we get interrupted */
-    if (signal_pending(current))
-      return -EINTR;
-  }
+  wait_event_interruptible(eeprom.wait_q, !eeprom.busy);
+  /* bail out if we get interrupted */
+  if (signal_pending(current))
+    return -EINTR;
   eeprom.busy++;
   for(i = 0; (i < EEPROM_RETRIES) && (restart > 0); i++)
   {

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors