subsys/storage/flash_map: Fix returned error codes
Fix that removes magic numbers from the code that leaded to the error codes that was hard to explain. Signed-off-by: Radoslaw Koppel <radoslaw.koppel@nordicsemi.no>
This commit is contained in:
parent
d1b4da96e1
commit
3fd417a1c9
1 changed files with 3 additions and 3 deletions
|
@ -180,7 +180,7 @@ int flash_area_read(const struct flash_area *fa, off_t off, void *dst,
|
|||
struct device *dev;
|
||||
|
||||
if (!is_in_flash_area_bounds(fa, off, len)) {
|
||||
return -1;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
dev = device_get_binding(fa->fa_dev_name);
|
||||
|
@ -195,7 +195,7 @@ int flash_area_write(const struct flash_area *fa, off_t off, const void *src,
|
|||
int rc;
|
||||
|
||||
if (!is_in_flash_area_bounds(fa, off, len)) {
|
||||
return -1;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
flash_dev = device_get_binding(fa->fa_dev_name);
|
||||
|
@ -219,7 +219,7 @@ int flash_area_erase(const struct flash_area *fa, off_t off, size_t len)
|
|||
int rc;
|
||||
|
||||
if (!is_in_flash_area_bounds(fa, off, len)) {
|
||||
return -1;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
flash_dev = device_get_binding(fa->fa_dev_name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue