mboxd: Remove flash API compatibility shim
The flash API compatibility was kept to reduce the line noise in the
previous backend patch. Remove the compatibility layer now and convert
the remaining call-sites.
Change-Id: I4b6e54f4463059a7804918add81e7572db7b7c21
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/test/flash_copy.c b/test/flash_copy.c
index 472315b..9300cff 100644
--- a/test/flash_copy.c
+++ b/test/flash_copy.c
@@ -71,7 +71,7 @@
assert(!backend_probe_mtd(&context.backend, tmp.path));
- flash_copy(&context, 0, dst, TEST_SIZE);
+ backend_copy(&context.backend, 0, dst, TEST_SIZE);
assert(0 == memcmp(src, dst, TEST_SIZE));
backend_free(&context.backend);
diff --git a/test/flash_erase.c b/test/flash_erase.c
index ad4e535..fe80f3b 100644
--- a/test/flash_erase.c
+++ b/test/flash_erase.c
@@ -117,7 +117,7 @@
assert(!backend_probe_mtd(backend, get_dev_mtd()));
/* Erase from an unknown state */
- rc = flash_erase(&context, 0, sizeof(data));
+ rc = backend_erase(backend, 0, sizeof(data));
assert(rc == 0);
assert(n_ioctls == 1);
@@ -129,7 +129,7 @@
n_ioctls = 0;
/* Erase an erased flash */
- rc = flash_erase(&context, 0, sizeof(data));
+ rc = backend_erase(backend, 0, sizeof(data));
assert(rc == 0);
assert(n_ioctls == 0);
@@ -137,9 +137,9 @@
memset(data, 0xaa, sizeof(data));
/* Erase written flash */
- rc = flash_write(&context, 0, data, sizeof(data));
+ rc = backend_write(backend, 0, data, sizeof(data));
assert(rc == 0);
- rc = flash_erase(&context, 0, sizeof(data));
+ rc = backend_erase(backend, 0, sizeof(data));
assert(rc == 0);
assert(n_ioctls == 1);
@@ -151,9 +151,9 @@
n_ioctls = 0;
/* Erase the start of flash */
- rc = flash_write(&context, 0, data, sizeof(data) - 1);
+ rc = backend_write(backend, 0, data, sizeof(data) - 1);
assert(rc == 0);
- rc = flash_erase(&context, 0, sizeof(data));
+ rc = backend_erase(backend, 0, sizeof(data));
assert(rc == 0);
assert(n_ioctls == 1);
@@ -165,9 +165,9 @@
n_ioctls = 0;
/* Erase the end of flash */
- rc = flash_write(&context, 1, data, sizeof(data) - 1);
+ rc = backend_write(backend, 1, data, sizeof(data) - 1);
assert(rc == 0);
- rc = flash_erase(&context, 0, sizeof(data));
+ rc = backend_erase(backend, 0, sizeof(data));
assert(rc == 0);
assert(n_ioctls == 1);
@@ -179,10 +179,10 @@
n_ioctls = 0;
/* Erase each end of flash */
- rc = flash_write(&context, 0, data, 1);
- rc = flash_write(&context, 2, data, 1);
+ rc = backend_write(backend, 0, data, 1);
+ rc = backend_write(backend, 2, data, 1);
assert(rc == 0);
- rc = flash_erase(&context, 0, sizeof(data));
+ rc = backend_erase(backend, 0, sizeof(data));
assert(rc == 0);
assert(n_ioctls == 2);
@@ -196,9 +196,9 @@
n_ioctls = 0;
/* Erase the middle of flash */
- rc = flash_write(&context, 1, data, 1);
+ rc = backend_write(backend, 1, data, 1);
assert(rc == 0);
- rc = flash_erase(&context, 0, sizeof(data));
+ rc = backend_erase(backend, 0, sizeof(data));
assert(rc == 0);
assert(n_ioctls == 1);
diff --git a/test/flash_write.c b/test/flash_write.c
index 168b2aa..c5f998c 100644
--- a/test/flash_write.c
+++ b/test/flash_write.c
@@ -74,31 +74,31 @@
assert(map != MAP_FAILED);
memset(src, 0xaa, sizeof(src));
- rc = flash_write(context, 0, src, sizeof(src));
+ rc = backend_write(backend, 0, src, sizeof(src));
assert(rc == 0);
rc = memcmp(src, map, sizeof(src));
assert(rc == 0);
memset(src, 0x55, sizeof(src));
- rc = flash_write(context, 0, src, sizeof(src));
+ rc = backend_write(backend, 0, src, sizeof(src));
assert(rc == 0);
rc = memcmp(src, map, sizeof(src));
assert(rc == 0);
src[0] = 0xff;
- rc = flash_write(context, 0, src, 1);
+ rc = backend_write(backend, 0, src, 1);
assert(rc == 0);
rc = memcmp(src, map, sizeof(src));
assert(rc == 0);
src[1] = 0xff;
- rc = flash_write(context, 1, &src[1], 1);
+ rc = backend_write(backend, 1, &src[1], 1);
assert(rc == 0);
rc = memcmp(src, map, sizeof(src));
assert(rc == 0);
src[2] = 0xff;
- rc = flash_write(context, 2, &src[2], 1);
+ rc = backend_write(backend, 2, &src[2], 1);
assert(rc == 0);
rc = memcmp(src, map, sizeof(src));
assert(rc == 0);