#include <common.h>
+#include <malloc.h>
#include <linux/types.h>
#include <linux/string.h>
#include <nand.h>
#include "../drivers/mmc/card_sdio.h"
#endif
+#ifdef CONFIG_FS_EXT4
+extern int ext4_read_content(int dev, wchar_t* partition_name, const char *filename, void *buf, int offset, int len);
+#endif
+
int do_fs_file_read(char *mpart, char *filenm, void *buf, int len)
{
int ret=-1;
cursct = info.start + off/EMMC_SECTOR_SIZE;
//read first unaligned data
if(offp) {
- if(!Emmc_Read(PARTITION_USER, cursct, 1, sctbuf))
+ if(!Emmc_Read(PARTITION_USER, cursct, 1, (uint8 *)sctbuf))
goto end;
cursct += 1;
memcpy(bufwp,sctbuf+offp,len);
}
//read sector aligned data
if(nsct) {
- if(!Emmc_Read(PARTITION_USER, cursct, nsct, bufwp))
+ if(!Emmc_Read(PARTITION_USER, cursct, nsct, (uint8 *)bufwp))
goto end;
cursct += nsct;
bufwp += size-left;
}
//read last unaligned data
if(left) {
- if(!Emmc_Read(PARTITION_USER, cursct, 1, sctbuf))
+ if(!Emmc_Read(PARTITION_USER, cursct, 1, (uint8 *)sctbuf))
goto end;
memcpy(bufwp,sctbuf,left);
bufwp += left;
}
ret = 0;
ubi_close_volume(vol);
-#endif
end:
+#endif
if (ret)
printf("do_raw_data_write error.\n");
return ret;