storage: 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 <andrzej.puzdrowski@nordicsemi.no>
This commit is contained in:
parent
1a6492d8b3
commit
45449c7b84
|
@ -210,16 +210,8 @@ int flash_area_write(const struct flash_area *fa, off_t off, const void *src,
|
|||
|
||||
flash_dev = device_get_binding(fa->fa_dev_name);
|
||||
|
||||
rc = flash_write_protection_set(flash_dev, false);
|
||||
if (rc) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = flash_write(flash_dev, fa->fa_off + off, (void *)src, len);
|
||||
|
||||
/* Ignore errors here - this does not affect write operation */
|
||||
(void) flash_write_protection_set(flash_dev, true);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -234,16 +226,8 @@ int flash_area_erase(const struct flash_area *fa, off_t off, size_t len)
|
|||
|
||||
flash_dev = device_get_binding(fa->fa_dev_name);
|
||||
|
||||
rc = flash_write_protection_set(flash_dev, false);
|
||||
if (rc) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = flash_erase(flash_dev, fa->fa_off + off, len);
|
||||
|
||||
/* Ignore errors here - this does not affect write operation */
|
||||
(void) flash_write_protection_set(flash_dev, true);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,9 +35,7 @@ int stream_flash_erase_page(struct stream_flash_ctx *ctx, off_t off)
|
|||
|
||||
LOG_DBG("Erasing page at offset 0x%08lx", (long)page.start_offset);
|
||||
|
||||
flash_write_protection_set(ctx->fdev, false);
|
||||
rc = flash_erase(ctx->fdev, page.start_offset, page.size);
|
||||
flash_write_protection_set(ctx->fdev, true);
|
||||
|
||||
if (rc != 0) {
|
||||
LOG_ERR("Error %d while erasing page", rc);
|
||||
|
@ -71,9 +69,7 @@ static int flash_sync(struct stream_flash_ctx *ctx)
|
|||
}
|
||||
}
|
||||
|
||||
flash_write_protection_set(ctx->fdev, false);
|
||||
rc = flash_write(ctx->fdev, write_addr, ctx->buf, ctx->buf_bytes);
|
||||
flash_write_protection_set(ctx->fdev, true);
|
||||
|
||||
if (rc != 0) {
|
||||
LOG_ERR("flash_write error %d offset=0x%08zx", rc,
|
||||
|
|
Loading…
Reference in a new issue