tests/subsys/storage/flash_map: get flash device from flash area
Get flash device from flash area instead of the hardcoded DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL. This makes the test possible to be ran on device that has image_1 defined in external flash. Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
This commit is contained in:
parent
b0717d518e
commit
a720f8c627
1 changed files with 1 additions and 2 deletions
|
@ -31,8 +31,7 @@ void test_flash_area_get_sectors(void)
|
|||
zassert_true(rc == 0, "flash_area_open() fail");
|
||||
|
||||
/* First erase the area so it's ready for use. */
|
||||
flash_dev =
|
||||
device_get_binding(DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL);
|
||||
flash_dev = flash_area_get_device(fa);
|
||||
|
||||
rc = flash_erase(flash_dev, fa->fa_off, fa->fa_size);
|
||||
zassert_true(rc == 0, "flash area erase fail");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue