summaryrefslogtreecommitdiff
path: root/board/trab/auto_update.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2007-08-12 18:12:38 +0200
committerWolfgang Denk <wd@denx.de>2007-08-12 18:12:38 +0200
commit0cfc9d6ad1f1d1385ed0c3f9ee550192e9d3eda2 (patch)
treedd9c9c5e49e4fa966ddbc9f4d4f103b90f284cf8 /board/trab/auto_update.c
parente27f3a6efb9db5a533223b05c629ff4ac8d921bf (diff)
parenta4d2636f2a859245ed3a401f26189da2dfda4ceb (diff)
downloadu-boot-imx-0cfc9d6ad1f1d1385ed0c3f9ee550192e9d3eda2.zip
u-boot-imx-0cfc9d6ad1f1d1385ed0c3f9ee550192e9d3eda2.tar.gz
u-boot-imx-0cfc9d6ad1f1d1385ed0c3f9ee550192e9d3eda2.tar.bz2
Merge with git+ssh://gemini_vpn/home/wd/git/u-boot/master
Diffstat (limited to 'board/trab/auto_update.c')
-rw-r--r--board/trab/auto_update.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/board/trab/auto_update.c b/board/trab/auto_update.c
index 92120b0..54d3645 100644
--- a/board/trab/auto_update.c
+++ b/board/trab/auto_update.c
@@ -450,7 +450,7 @@ do_auto_update(void)
{
block_dev_desc_t *stor_dev;
long sz;
- int i, res, bitmap_first, cnt, old_ctrlc, got_ctrlc;
+ int i, res = 0, bitmap_first, cnt, old_ctrlc, got_ctrlc;
char *env;
long start, end;
@@ -477,18 +477,21 @@ do_auto_update(void)
au_usb_stor_curr_dev = usb_stor_scan(0);
if (au_usb_stor_curr_dev == -1) {
debug ("No device found. Not initialized?\n");
- return -1;
+ res = -1;
+ goto xit;
}
/* check whether it has a partition table */
stor_dev = get_dev("usb", 0);
if (stor_dev == NULL) {
debug ("uknown device type\n");
- return -1;
+ res = -1;
+ goto xit;
}
if (fat_register_device(stor_dev, 1) != 0) {
debug ("Unable to use USB %d:%d for fatls\n",
au_usb_stor_curr_dev, 1);
- return -1;
+ res = -1;
+ goto xit;
}
if (file_fat_detectfs() != 0) {
debug ("file_fat_detectfs failed\n");
@@ -648,9 +651,10 @@ do_auto_update(void)
/* enable the power switch */
*CPLD_VFD_BK &= ~POWER_OFF;
}
- usb_stop();
/* restore the old state */
disable_ctrlc(old_ctrlc);
- return 0;
+xit:
+ usb_stop();
+ return res;
}
#endif /* CONFIG_AUTO_UPDATE */