usbd: Fix erase modem partition
authorJoonyoung Shim <jy0922.shim@samsung.com>
Fri, 12 Nov 2010 12:27:55 +0000 (21:27 +0900)
committerJoonyoung Shim <jy0922.shim@samsung.com>
Fri, 12 Nov 2010 12:27:55 +0000 (21:27 +0900)
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
common/cmd_usbd.c

index 945717e..aa7c516 100644 (file)
@@ -1108,6 +1108,12 @@ static int process_data(struct usbd_ops *usbd)
                sprintf(offset, "%x", parts[part_id]->offset);
                sprintf(length, "%x", parts[part_id]->size);
 
+               /* Erase */
+               if (!arg)
+                       nand_cmd(0, offset, length, NULL);
+               else
+                       printf("CSA Clear will be skipped temporary\n");
+
                /* Check ubi image, 0x23494255 is UBI# */
                {
                        long *img_header = (long *)down_ram_addr;
@@ -1116,12 +1122,6 @@ static int process_data(struct usbd_ops *usbd)
                                goto ubi_img;
                }
 
-               /* Erase */
-               if (!arg)
-                       nand_cmd(0, offset, length, NULL);
-               else
-                       printf("CSA Clear will be skipped temporary\n");
-
 #ifdef CONFIG_UBIFS_MK
                void *dest_addr = (void *) down_ram_addr + 0xc00000;
                void *src_addr = (void *) down_ram_addr;