From 1960a5d23438c4f5cba20a905d360fd5a223240c Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Wed, 17 Mar 2021 11:10:55 +0100 Subject: [PATCH] disk/disk_acces_flash: remove flash_write_protection_set() usage This patch removes scenario which was testing deprecated API behaviors. Needed as As flash_write_protection_set() was deprecated and became no-operation. Signed-off-by: Andrzej Puzdrowski --- drivers/disk/flashdisk.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/disk/flashdisk.c b/drivers/disk/flashdisk.c index a1447127736..686668ce21c 100644 --- a/drivers/disk/flashdisk.c +++ b/drivers/disk/flashdisk.c @@ -159,8 +159,6 @@ static int update_flash_block(off_t start_addr, uint32_t size, const void *buff) /* always align starting address for flash write operation */ fl_addr = ROUND_DOWN(start_addr, CONFIG_DISK_FLASH_ERASE_ALIGNMENT); - /* disable write-protection first before erase */ - flash_write_protection_set(flash_dev, false); if (flash_erase(flash_dev, fl_addr, CONFIG_DISK_ERASE_BLOCK_SIZE) != 0) { return -EIO; @@ -171,9 +169,6 @@ static int update_flash_block(off_t start_addr, uint32_t size, const void *buff) CONFIG_DISK_FLASH_MAX_RW_SIZE); for (uint32_t i = 0; i < num_write; i++) { - /* flash_write reenabled write-protection so disable it again */ - flash_write_protection_set(flash_dev, false); - if (flash_write(flash_dev, fl_addr, src, CONFIG_DISK_FLASH_MAX_RW_SIZE) != 0) { return -EIO;