subsys: storage: flash_map: add API for check flash driver support
Some applications might want to check whether flash_areas binds to any flash drive in the system. It might be better to do that while sanity check at application start-up then while regular run process. Example of such application is the mcuboot. This patch introduce such API for checking whether device bindings were resolved properly during system startup. Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
This commit is contained in:
parent
12c02448aa
commit
5df93af87a
2 changed files with 19 additions and 0 deletions
|
@ -264,6 +264,15 @@ u8_t flash_area_align(const struct flash_area *fa)
|
|||
return flash_get_write_block_size(dev);
|
||||
}
|
||||
|
||||
int flash_area_has_driver(const struct flash_area *fa)
|
||||
{
|
||||
if (get_flash_dev_from_id(fa->fa_device_id) == NULL) {
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int flash_map_init(struct device *dev)
|
||||
{
|
||||
unsigned int i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue