@ -73,16 +73,12 @@ static int mmc_file_op(enum dfu_op op, struct dfu_entity *dfu,
op = = DFU_OP_READ ? " load " : " write " ,
op = = DFU_OP_READ ? " load " : " write " ,
dfu - > data . mmc . dev , dfu - > data . mmc . part ,
dfu - > data . mmc . dev , dfu - > data . mmc . part ,
( unsigned int ) buf , dfu - > name ) ;
( unsigned int ) buf , dfu - > name ) ;
if ( op = = DFU_OP_WRITE )
sprintf ( cmd_buf + strlen ( cmd_buf ) , " %lx " , * len ) ;
break ;
break ;
case DFU_FS_EXT4 :
case DFU_FS_EXT4 :
sprintf ( cmd_buf , " ext4%s mmc %d:%d 0x%x /%s " ,
sprintf ( cmd_buf , " ext4%s mmc %d:%d 0x%x /%s " ,
op = = DFU_OP_READ ? " load " : " write " ,
op = = DFU_OP_READ ? " load " : " write " ,
dfu - > data . mmc . dev , dfu - > data . mmc . part ,
dfu - > data . mmc . dev , dfu - > data . mmc . part ,
( unsigned int ) buf , dfu - > name ) ;
( unsigned int ) buf , dfu - > name ) ;
if ( op = = DFU_OP_WRITE )
sprintf ( cmd_buf + strlen ( cmd_buf ) , " %ld " , * len ) ;
break ;
break ;
default :
default :
printf ( " %s: Layout (%s) not (yet) supported! \n " , __func__ ,
printf ( " %s: Layout (%s) not (yet) supported! \n " , __func__ ,
@ -90,6 +86,9 @@ static int mmc_file_op(enum dfu_op op, struct dfu_entity *dfu,
return - 1 ;
return - 1 ;
}
}
if ( op = = DFU_OP_WRITE )
sprintf ( cmd_buf + strlen ( cmd_buf ) , " %lx " , * len ) ;
debug ( " %s: %s 0x%p \n " , __func__ , cmd_buf , cmd_buf ) ;
debug ( " %s: %s 0x%p \n " , __func__ , cmd_buf , cmd_buf ) ;
ret = run_command ( cmd_buf , 0 ) ;
ret = run_command ( cmd_buf , 0 ) ;