tree fe0fbd8a7b25115833c18a6d0d1986c051e6badc
parent b81226c5d55b16a23f044d37b45e9b6909d8fbce
author Nicolas Pitre <[EMAIL PROTECTED]> Thu, 17 Feb 2005 20:35:04 +0000
committer Thomas Gleixner <[EMAIL PROTECTED]> Mon, 23 May 2005 12:39:55 +0200

[MTD] Make OTP actually work.

The OTP code is rather broken without this.

Signed-off-by: Nicolas Pitre <[EMAIL PROTECTED]>
Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>

 drivers/mtd/chips/cfi_cmdset_0001.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c 
b/drivers/mtd/chips/cfi_cmdset_0001.c
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -4,7 +4,7 @@
  *
  * (C) 2000 Red Hat. GPL'd
  *
- * $Id: cfi_cmdset_0001.c,v 1.167 2005/02/08 17:11:15 nico Exp $
+ * $Id: cfi_cmdset_0001.c,v 1.168 2005/02/17 20:34:59 nico Exp $
  *
  * 
  * 10/10/2000  Nicolas Pitre <[EMAIL PROTECTED]>
@@ -2025,7 +2025,7 @@ do_otp_lock(struct map_info *map, struct
        map_word datum;
 
        /* make sure area matches group boundaries */
-       if (offset != 0 || size != grpsz)
+       if (size != grpsz)
                return -EXDEV;
 
        datum = map_word_ff(map);
@@ -2089,7 +2089,7 @@ static int cfi_intelext_otp_walk(struct 
                                groupno = 0;
                        }
 
-                       while (groups > 0) {
+                       while (len > 0 && groups > 0) {
                                if (!action) {
                                        /*
                                         * Special case: if action is NULL
@@ -2118,6 +2118,7 @@ static int cfi_intelext_otp_walk(struct 
                                        *retlen += sizeof(*otpinfo);
                                } else if (from >= groupsize) {
                                        from -= groupsize;
+                                       data_offset += groupsize;
                                } else {
                                        int size = groupsize;
                                        data_offset += from;
@@ -2133,6 +2134,7 @@ static int cfi_intelext_otp_walk(struct 
                                        buf += size;
                                        len -= size;
                                        *retlen += size;
+                                       data_offset += size;
                                }
                                groupno++;
                                groups--;
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to