recovery: update: fix the erase size when bootloader only updated
authorSanghee Kim <sh0130.kim@samsung.com>
Mon, 3 May 2010 11:30:42 +0000 (20:30 +0900)
committerSanghee Kim <sh0130.kim@samsung.com>
Mon, 3 May 2010 11:30:42 +0000 (20:30 +0900)
common/cmd_usbd.c

index 2a1c15a..44c57fd 100644 (file)
@@ -922,7 +922,10 @@ static int process_data(struct usbd_ops *usbd)
                }
 #endif
                sprintf(offset, "%x", ofs);
-               sprintf(length, "%x", parts[part_id]->size);
+               if (ofs != 0)
+                       sprintf(length, "%x", parts[part_id]->size - ofs);
+               else
+                       sprintf(length, "%x", parts[part_id]->size);
 
                /* Erase */
                nand_cmd(0, offset, length, NULL);