]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - fs/fs.c
fs: fix generic save command implementation
[karo-tx-uboot.git] / fs / fs.c
diff --git a/fs/fs.c b/fs/fs.c
index be1855d1291f217b19720ae0faa45076eb0cc5ac..9c2ef6b6597ca30de8b49aeb9d5e0c1e1663d907 100644 (file)
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -75,6 +75,7 @@ static struct fstype_info fstypes[] = {
                .close = fat_close,
                .ls = file_fat_ls,
                .read = fat_read_file,
+               .write = fs_write_unsupported,
        },
 #endif
 #ifdef CONFIG_FS_EXT4
@@ -84,6 +85,7 @@ static struct fstype_info fstypes[] = {
                .close = ext4fs_close,
                .ls = ext4fs_ls,
                .read = ext4_read_file,
+               .write = fs_write_unsupported,
        },
 #endif
 #ifdef CONFIG_SANDBOX
@@ -212,16 +214,11 @@ int fs_write(const char *filename, ulong addr, int offset, int len)
        void *buf;
        int ret;
 
-       /*
-        * We don't actually know how many bytes are being read, since len==0
-        * means read the whole file.
-        */
        buf = map_sysmem(addr, len);
        ret = info->write(filename, buf, offset, len);
        unmap_sysmem(buf);
 
-       /* If we requested a specific number of bytes, check we got it */
-       if (ret >= 0 && len && ret != len) {
+       if (ret >= 0 && ret != len) {
                printf("** Unable to write file %s **\n", filename);
                ret = -1;
        }