]> git.sur5r.net Git - openocd/blobdiff - src/flash/ecos.c
ocd_flash_banks now returns empty list when no flash banks are configured instead...
[openocd] / src / flash / ecos.c
index 8b64b2d71346524881f716320e0ff430a9ba487d..f6c2442f16c663e187ca4d022d31d376faadbbe4 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2008 Øyvind Harboe                                      *
+ *   Copyright (C) 2007,2008 Øyvind Harboe                                 *
  *   oyvind.harboe@zylin.com                                               *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -195,10 +195,11 @@ int loadDriver(ecosflash_flash_bank_t *info)
        image.base_address_set = 0;
        image.start_address_set = 0;
        target_t *target=info->target;
+       int retval;
        
-       if (image_open(&image, info->driverPath, NULL) != ERROR_OK)
+       if ((retval=image_open(&image, info->driverPath, NULL)) != ERROR_OK)
        {
-               return ERROR_FLASH_BANK_INVALID;
+               return retval;
        }
        
        info->start_address=image.start_address;