From: Nishanth Aravamudan Subject: [KJ] [PATCH] cris/eeprom: replace interruptible_sleep_on() with wait_event_interruptible() 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. Signed-off-by: Nishanth Aravamudan Signed-off-by: Domen Puncer --- eeprom.c | 24 ++++++++---------------- 1 files changed, 8 insertions(+), 16 deletions(-) Index: quilt/arch/cris/arch-v10/drivers/eeprom.c =================================================================== --- quilt.orig/arch/cris/arch-v10/drivers/eeprom.c +++ quilt/arch/cris/arch-v10/drivers/eeprom.c @@ -94,6 +94,7 @@ #include #include #include +#include #include #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++) {