summaryrefslogtreecommitdiff
path: root/common/cmd_ext4.c
diff options
context:
space:
mode:
authorRob Herring <rob.herring@calxeda.com>2012-08-23 11:31:45 +0000
committerTom Rini <trini@ti.com>2012-09-25 14:46:35 -0700
commit945010629641b00cca95d1fed4f63009a2b4a113 (patch)
tree84ea14ad3f81b39a8d65640bf10d6851e103f96e /common/cmd_ext4.c
parent99d2c205d4a151faf5f9a406316b9dd960f43475 (diff)
downloadu-boot-imx-945010629641b00cca95d1fed4f63009a2b4a113.zip
u-boot-imx-945010629641b00cca95d1fed4f63009a2b4a113.tar.gz
u-boot-imx-945010629641b00cca95d1fed4f63009a2b4a113.tar.bz2
ext4: remove init_fs/deinit_fs
There's no real need to expose this and it can be removed by using a static allocation. Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Diffstat (limited to 'common/cmd_ext4.c')
-rw-r--r--common/cmd_ext4.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/common/cmd_ext4.c b/common/cmd_ext4.c
index 77094c4..e92c02f 100644
--- a/common/cmd_ext4.c
+++ b/common/cmd_ext4.c
@@ -151,8 +151,6 @@ int do_ext4_write(cmd_tbl_t *cmdtp, int flag, int argc,
printf("Block device %s %d not supported\n", argv[1], dev);
return 1;
}
- if (init_fs(ext4_dev_desc))
- return 1;
fs = get_fs();
if (*ep) {
@@ -173,21 +171,21 @@ int do_ext4_write(cmd_tbl_t *cmdtp, int flag, int argc,
file_size = simple_strtoul(argv[5], NULL, 10);
/* set the device as block device */
- part_length = ext4fs_set_blk_dev(fs->dev_desc, part);
+ part_length = ext4fs_set_blk_dev(ext4_dev_desc, part);
if (part_length == 0) {
printf("Bad partition - %s %d:%lu\n", argv[1], dev, part);
goto fail;
}
/* register the device and partition */
- if (ext4_register_device(fs->dev_desc, part) != 0) {
+ if (ext4_register_device(ext4_dev_desc, part) != 0) {
printf("Unable to use %s %d:%lu for fattable\n",
argv[1], dev, part);
goto fail;
}
/* get the partition information */
- if (!get_partition_info(fs->dev_desc, part, &info)) {
+ if (!get_partition_info(ext4_dev_desc, part, &info)) {
total_sector = (info.size * info.blksz) / SECTOR_SIZE;
fs->total_sect = total_sector;
} else {
@@ -207,13 +205,11 @@ int do_ext4_write(cmd_tbl_t *cmdtp, int flag, int argc,
goto fail;
}
ext4fs_close();
- deinit_fs(fs->dev_desc);
return 0;
fail:
ext4fs_close();
- deinit_fs(fs->dev_desc);
return 1;
}