Skip to content
Permalink
Browse files

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>
  • Loading branch information...
rakons authored and carlescufi committed May 23, 2019
1 parent d1b4da9 commit 3fd417a1c9bf2f53cfcc493a034fe64c58d56c1a
Showing with 3 additions and 3 deletions.
  1. +3 −3 subsys/storage/flash_map/flash_map.c
@@ -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);

0 comments on commit 3fd417a

Please sign in to comment.
You can’t perform that action at this time.