Skip to content

Commit

Permalink
treewide: Remove calls to deprecated flash_write_protection_set
Browse files Browse the repository at this point in the history
Flash write protection is now handled automatically inside the flash
write and erase functions, and flash_write_protection_set is deprecated.
See zephyrproject-rtos/zephyr#33216 for details.

Signed-off-by: Trond Einar Snekvik <[email protected]>
  • Loading branch information
trond-snekvik committed Apr 30, 2021
1 parent 1c63ee0 commit c0c78fb
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 9 deletions.
1 change: 0 additions & 1 deletion tests/drivers/fprotect/negative/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ static void flash_write_protected_fails(uint32_t addr, bool backup)
err = flash_read(flash_dev, addr, read_buf, sizeof(read_buf));
zassert_equal(0, err, "flash_read() failed: %d.\n", err);
}
(void) flash_write_protection_set(flash_dev, false);
printk("NOTE: A BUS FAULT immediately after this message"
" means the test passed!\n");
zassert_equal(expected_fatal, actual_fatal, "An unexpected fatal error has occurred.\n");
Expand Down
1 change: 0 additions & 1 deletion tests/drivers/fprotect/positive/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ static void test_flash_write(void)
ARRAY_SIZE(read_data_before));

zassert_true(retval == 0, "flash_read failed");
(void) flash_write_protection_set(flash_dev, false);
retval = flash_write(flash_dev, valid_write_addr, write_data,
ARRAY_SIZE(write_data));
zassert_true(retval == 0, "flash_write failed");
Expand Down
1 change: 0 additions & 1 deletion tests/subsys/fw_info/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ void test_fw_info_invalidate(void)
int ret;

const struct device *flash_dev = device_get_binding(PM_S0_DEV_NAME);
(void) flash_write_protection_set(flash_dev, false);

/* Write a dummy upgrade to S1 */
if (!fw_info_check(S1_ADDRESS)) {
Expand Down
6 changes: 0 additions & 6 deletions tests/subsys/net/lib/fota_download/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,19 +155,13 @@ void set_s0_active(bool s0_active)
err = flash_erase(fdev, PM_S1_ADDRESS, nrfx_nvmc_flash_page_size_get());
zassert_equal(err, 0, "flash_erase failed");

err = flash_write_protection_set(fdev, false);
zassert_equal(err, 0, "Disabling flash protection failed");

err = flash_write(fdev, PM_S0_ADDRESS, (void *)&s0_info,
sizeof(s0_info));
zassert_equal(err, 0, "Unable to write to flash");

err = flash_write(fdev, PM_S1_ADDRESS, (void *)&s1_info,
sizeof(s1_info));
zassert_equal(err, 0, "Unable to write to flash");

err = flash_write_protection_set(fdev, true);
zassert_equal(err, 0, "Enabling flash protection failed");
}
#endif

Expand Down

0 comments on commit c0c78fb

Please sign in to comment.