From 20a32dc8582919e5e5436ca475bda364ebd5ce1f Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 21 May 2010 11:26:35 -0400 Subject: [PATCH] --- yaml --- r: 197999 b: refs/heads/master c: 82f3952c02add60b15eea9151d4d99b6b82066c6 h: refs/heads/master i: 197997: 49934c35243d3f2e3aafdf60400171f17a6f30f3 197995: 3dac67837b5a3a3da567c2413b0f1f81591ae6d8 197991: ba3d3fdd4b0e21eb7f40217f73f4e4be82dc26b3 197983: 592a522a34317ca6e116721846260e50aefd542d v: v3 --- [refs] | 2 +- trunk/arch/cris/arch-v10/drivers/eeprom.c | 21 +++++++-------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/[refs] b/[refs] index 8bcaf5332650..f4769f45d4ac 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4f0447b8184acb1d21b0fd71683d72ef2b83167b +refs/heads/master: 82f3952c02add60b15eea9151d4d99b6b82066c6 diff --git a/trunk/arch/cris/arch-v10/drivers/eeprom.c b/trunk/arch/cris/arch-v10/drivers/eeprom.c index b04b22ba00d1..c3405507a3d1 100644 --- a/trunk/arch/cris/arch-v10/drivers/eeprom.c +++ b/trunk/arch/cris/arch-v10/drivers/eeprom.c @@ -437,10 +437,7 @@ static loff_t eeprom_lseek(struct file * file, loff_t offset, int orig) static int eeprom_read_buf(loff_t addr, char * buf, int count) { - struct file f; - - f.f_pos = addr; - return eeprom_read(&f, buf, count, &addr); + return eeprom_read(NULL, buf, count, &addr); } @@ -450,7 +447,7 @@ static int eeprom_read_buf(loff_t addr, char * buf, int count) static ssize_t eeprom_read(struct file * file, char * buf, size_t count, loff_t *off) { int read=0; - unsigned long p = file->f_pos; + unsigned long p = *off; unsigned char page; @@ -495,7 +492,7 @@ static ssize_t eeprom_read(struct file * file, char * buf, size_t count, loff_t if(read > 0) { - file->f_pos += read; + *off += read; } mutex_unlock(&eeprom.lock); @@ -506,11 +503,7 @@ static ssize_t eeprom_read(struct file * file, char * buf, size_t count, loff_t static int eeprom_write_buf(loff_t addr, const char * buf, int count) { - struct file f; - - f.f_pos = addr; - - return eeprom_write(&f, buf, count, &addr); + return eeprom_write(NULL, buf, count, &addr); } @@ -534,7 +527,7 @@ static ssize_t eeprom_write(struct file * file, const char * buf, size_t count, { restart = 0; written = 0; - p = file->f_pos; + p = *off; while( (written < count) && (p < eeprom.size)) @@ -660,10 +653,10 @@ static ssize_t eeprom_write(struct file * file, const char * buf, size_t count, } /* for */ mutex_unlock(&eeprom.lock); - if (written == 0 && file->f_pos >= eeprom.size){ + if (written == 0 && p >= eeprom.size){ return -ENOSPC; } - file->f_pos += written; + *off = p; return written; }