/* cycle through bank list */
for (c = flash_banks; c; c = c->next) {
+ if (c->target != target)
+ continue;
+
int retval;
retval = c->driver->auto_probe(c);
return retval;
}
/* check whether address belongs to this flash bank */
- if ((addr >= c->base) && (addr <= c->base + (c->size - 1)) && target == c->target) {
+ if ((addr >= c->base) && (addr <= c->base + (c->size - 1))) {
*result_bank = c;
return ERROR_OK;
}
int i;
for (i = 0; i < flash_get_bank_count(); i++) {
struct flash_bank *p;
+ p = get_flash_bank_by_num_noprobe(i);
+ if (p->target != gdb_service->target)
+ continue;
retval = get_flash_bank_by_num(i, &p);
if (retval != ERROR_OK) {
LOG_ERROR("Connect failed. Consider setting up a gdb-attach event for the target " \
banks = malloc(sizeof(struct flash_bank *)*flash_get_bank_count());
for (i = 0; i < flash_get_bank_count(); i++) {
+ p = get_flash_bank_by_num_noprobe(i);
+ if (p->target != target)
+ continue;
retval = get_flash_bank_by_num(i, &p);
if (retval != ERROR_OK) {
free(banks);
gdb_error(connection, retval);
return retval;
}
- if (p->target == target)
- banks[target_flash_banks++] = p;
+ banks[target_flash_banks++] = p;
}
qsort(banks, target_flash_banks, sizeof(struct flash_bank *),