X-Git-Url: https://review.openocd.org/gitweb?a=blobdiff_plain;f=src%2Fflash%2Fnor%2Ftms470.c;h=2f02e5d77cf9da23effd2b2797af76923457e82a;hb=4cc359794420dbe0aedba38bde0ee4d871cdb354;hp=edb43afa2f5c1782867a276fda0417e1181bc8ab;hpb=41cb9118536db5e5e2836ad6c75daae1d21b6f4a;p=openocd.git diff --git a/src/flash/nor/tms470.c b/src/flash/nor/tms470.c index edb43afa2f..2f02e5d77c 100644 --- a/src/flash/nor/tms470.c +++ b/src/flash/nor/tms470.c @@ -139,6 +139,12 @@ static int tms470_read_part_info(struct flash_bank *bank) rom_flash = (device_ident_reg >> 10) & 1; part_number = (device_ident_reg >> 3) & 0x7f; + if (bank->sectors) + { + free(bank->sectors); + bank->sectors = NULL; + } + /* * If the part number is known, determine if the flash bank is valid * based on the base address being within the known flash bank @@ -1209,7 +1215,7 @@ static int tms470_protect_check(struct flash_bank *bank) /* ---------------------------------------------------------------------- */ -static int tms470_info(struct flash_bank *bank, char *buf, int buf_size) +static int get_tms470_info(struct flash_bank *bank, char *buf, int buf_size) { int used = 0; struct tms470_flash_bank *tms470_info = bank->driver_priv; @@ -1264,9 +1270,10 @@ struct flash_driver tms470_flash = { .erase = tms470_erase, .protect = tms470_protect, .write = tms470_write, + .read = default_flash_read, .probe = tms470_probe, .auto_probe = tms470_auto_probe, .erase_check = tms470_erase_check, .protect_check = tms470_protect_check, - .info = tms470_info, + .info = get_tms470_info, };