Skip to content
Snippets Groups Projects
Commit e0f0ce96 authored by Andrey Smirnov's avatar Andrey Smirnov Committed by Paul Fertser
Browse files

at91samd: Remove 'first' and 'last' checks in 'samd_erase'


Remove 'first' and 'last' checks in 'samd_protect' since those
parameters are checked in 'handle_flash_erase_command'.

Change-Id: I30e5598a9ab656d81055f26cc63e291377605300
Signed-off-by: default avatarAndrey Smirnov <andrew.smirnov@gmail.com>
Reviewed-on: http://openocd.zylin.com/2024


Tested-by: jenkins
Reviewed-by: default avatarAndrey Yurovsky <yurovsky@gmail.com>
Reviewed-by: default avatarPaul Fertser <fercerpav@gmail.com>
parent 207237b9
Branches
Tags
No related merge requests found
......@@ -352,13 +352,6 @@ static int samd_erase(struct flash_bank *bank, int first, int last)
return ERROR_FLASH_BANK_NOT_PROBED;
}
/* Make sure the sectors make sense. */
if (first >= bank->num_sectors || last >= bank->num_sectors) {
LOG_ERROR("Erase range %d - %d not valid (%d sectors total)",
first, last, bank->num_sectors);
return ERROR_FAIL;
}
/* The SAMD NVM has row erase granularity. There are four pages in a row
* and the number of rows in a sector depends on the sector size, which in
* turn depends on the Flash capacity as there is a fixed number of
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment