aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v10/drivers/eeprom.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/cris/arch-v10/drivers/eeprom.c')
-rw-r--r--arch/cris/arch-v10/drivers/eeprom.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/arch/cris/arch-v10/drivers/eeprom.c b/arch/cris/arch-v10/drivers/eeprom.c
index 316ca15d6802..512f16dec060 100644
--- a/arch/cris/arch-v10/drivers/eeprom.c
+++ b/arch/cris/arch-v10/drivers/eeprom.c
@@ -20,6 +20,12 @@
20*! in the spin-lock. 20*! in the spin-lock.
21*! 21*!
22*! $Log: eeprom.c,v $ 22*! $Log: eeprom.c,v $
23*! Revision 1.12 2005/06/19 17:06:46 starvik
24*! Merge of Linux 2.6.12.
25*!
26*! Revision 1.11 2005/01/26 07:14:46 starvik
27*! Applied diff from kernel janitors (Nish Aravamudan).
28*!
23*! Revision 1.10 2003/09/11 07:29:48 starvik 29*! Revision 1.10 2003/09/11 07:29:48 starvik
24*! Merge of Linux 2.6.0-test5 30*! Merge of Linux 2.6.0-test5
25*! 31*!
@@ -94,6 +100,7 @@
94#include <linux/init.h> 100#include <linux/init.h>
95#include <linux/delay.h> 101#include <linux/delay.h>
96#include <linux/interrupt.h> 102#include <linux/interrupt.h>
103#include <linux/wait.h>
97#include <asm/uaccess.h> 104#include <asm/uaccess.h>
98#include "i2c.h" 105#include "i2c.h"
99 106
@@ -526,15 +533,10 @@ static ssize_t eeprom_read(struct file * file, char * buf, size_t count, loff_t
526 return -EFAULT; 533 return -EFAULT;
527 } 534 }
528 535
529 while(eeprom.busy) 536 wait_event_interruptible(eeprom.wait_q, !eeprom.busy);
530 { 537 if (signal_pending(current))
531 interruptible_sleep_on(&eeprom.wait_q); 538 return -EINTR;
532 539
533 /* bail out if we get interrupted */
534 if (signal_pending(current))
535 return -EINTR;
536
537 }
538 eeprom.busy++; 540 eeprom.busy++;
539 541
540 page = (unsigned char) (p >> 8); 542 page = (unsigned char) (p >> 8);
@@ -604,13 +606,10 @@ static ssize_t eeprom_write(struct file * file, const char * buf, size_t count,
604 return -EFAULT; 606 return -EFAULT;
605 } 607 }
606 608
607 while(eeprom.busy) 609 wait_event_interruptible(eeprom.wait_q, !eeprom.busy);
608 { 610 /* bail out if we get interrupted */
609 interruptible_sleep_on(&eeprom.wait_q); 611 if (signal_pending(current))
610 /* bail out if we get interrupted */ 612 return -EINTR;
611 if (signal_pending(current))
612 return -EINTR;
613 }
614 eeprom.busy++; 613 eeprom.busy++;
615 for(i = 0; (i < EEPROM_RETRIES) && (restart > 0); i++) 614 for(i = 0; (i < EEPROM_RETRIES) && (restart > 0); i++)
616 { 615 {