X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fath79.c;h=c551f27223512301ae8a8a5b7cddb6bff2247d82;hp=d73a4916fac1d2ebaf4147302dff9b533c823285;hb=a7479fa89def9d8b1854d629dfdaa0ba17132617;hpb=42f1cc576ab9b503fadd0b8916a139cd0bc6563e diff --git a/src/flash/nor/ath79.c b/src/flash/nor/ath79.c index d73a4916fa..c551f27223 100644 --- a/src/flash/nor/ath79.c +++ b/src/flash/nor/ath79.c @@ -653,13 +653,6 @@ static int ath79_write(struct flash_bank *bank, const uint8_t *buffer, LOG_DEBUG("%s: offset=0x%08" PRIx32 " count=0x%08" PRIx32, __func__, offset, count); - if (offset < bank->base || offset >= bank->base + bank->size) { - LOG_ERROR("Start address out of range"); - return ERROR_FAIL; - } - - offset -= bank->base; - if (target->state != TARGET_HALTED) { LOG_ERROR("Target not halted"); return ERROR_TARGET_NOT_HALTED; @@ -729,13 +722,6 @@ static int ath79_read(struct flash_bank *bank, uint8_t *buffer, LOG_DEBUG("%s: offset=0x%08" PRIx32 " count=0x%08" PRIx32, __func__, offset, count); - if (offset < bank->base || offset >= bank->base + bank->size) { - LOG_ERROR("Start address out of range"); - return ERROR_FAIL; - } - - offset -= bank->base; - if (target->state != TARGET_HALTED) { LOG_ERROR("Target not halted"); return ERROR_TARGET_NOT_HALTED; @@ -808,7 +794,7 @@ static int ath79_probe(struct flash_bank *bank) ath79_info->io_base = target_device->io_base; - LOG_DEBUG("Found device %s at address 0x%" PRIx32, + LOG_DEBUG("Found device %s at address " TARGET_ADDR_FMT, target_device->name, bank->base); retval = read_flash_id(bank, &id); @@ -909,7 +895,7 @@ static int get_ath79_info(struct flash_bank *bank, char *buf, int buf_size) return ERROR_OK; } -struct flash_driver ath79_flash = { +const struct flash_driver ath79_flash = { .name = "ath79", .flash_bank_command = ath79_flash_bank_command, .erase = ath79_erase,