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/vpnor/test/write_patch.cpp b/vpnor/test/write_patch.cpp
index 4f59db5..4a200c0 100644
--- a/vpnor/test/write_patch.cpp
+++ b/vpnor/test/write_patch.cpp
@@ -57,7 +57,7 @@
 
     /* Test */
     memset(src, 0x33, sizeof(src));
-    rc = flash_write(ctx, 0x1000, src, sizeof(src));
+    rc = backend_write(&ctx->backend, 0x1000, src, sizeof(src));
     assert(rc == 0);
 
     /* Check that RW file is unmodified after the patch write */
diff --git a/vpnor/test/write_patch_resize.cpp b/vpnor/test/write_patch_resize.cpp
index ce128c8..38effd6 100644
--- a/vpnor/test/write_patch_resize.cpp
+++ b/vpnor/test/write_patch_resize.cpp
@@ -56,7 +56,7 @@
 
     /* Test */
     std::vector<uint8_t> update(UPDATE_SIZE, 0x55);
-    rc = flash_write(ctx, 0x1000, update.data(), update.size());
+    rc = backend_write(&ctx->backend, 0x1000, update.data(), update.size());
     assert(rc == 0);
 
     /* Check that PATCH is modified with the new data */
diff --git a/vpnor/test/write_prsv.cpp b/vpnor/test/write_prsv.cpp
index 9ee1fb3..134a98e 100644
--- a/vpnor/test/write_prsv.cpp
+++ b/vpnor/test/write_prsv.cpp
@@ -46,7 +46,7 @@
 
     /* Test */
     memset(src, 0xaa, sizeof(src));
-    rc = flash_write(ctx, 0x1000, src, sizeof(src));
+    rc = backend_write(&ctx->backend, 0x1000, src, sizeof(src));
     assert(rc == 0);
 
     /* Verify */
diff --git a/vpnor/test/write_ro.cpp b/vpnor/test/write_ro.cpp
index e6bedd3..5965ebf 100644
--- a/vpnor/test/write_ro.cpp
+++ b/vpnor/test/write_ro.cpp
@@ -43,7 +43,7 @@
     test::VpnorRoot root(&ctx->backend, toc, BLOCK_SIZE);
 
     /* Test */
-    rc = flash_write(ctx, 0x1000, src, sizeof(src));
+    rc = backend_write(&ctx->backend, 0x1000, src, sizeof(src));
 
     /* Verify we can't write to RO partitions */
     assert(rc != 0);
diff --git a/vpnor/test/write_rw.cpp b/vpnor/test/write_rw.cpp
index 3b742a1..cf9bf7b 100644
--- a/vpnor/test/write_rw.cpp
+++ b/vpnor/test/write_rw.cpp
@@ -48,7 +48,7 @@
 
     /* Test */
     memset(src, 0xbb, sizeof(src));
-    rc = flash_write(ctx, 0x1000, src, sizeof(src));
+    rc = backend_write(&ctx->backend, 0x1000, src, sizeof(src));
     assert(rc == 0);
     fd = open((root.rw() / "TEST1").c_str(), O_RDONLY);
     map = mmap(NULL, sizeof(src), PROT_READ, MAP_SHARED, fd, 0);
@@ -58,31 +58,31 @@
 
     /* Ensure single byte writes function */
     memset(src, 0xcc, sizeof(src));
-    rc = flash_write(ctx, 0x1000, src, sizeof(src));
+    rc = backend_write(&ctx->backend, 0x1000, src, sizeof(src));
     assert(rc == 0);
     rc = memcmp(src, map, sizeof(src));
     assert(rc == 0);
 
     src[0] = 0xff;
-    rc = flash_write(ctx, 0x1000, src, 1);
+    rc = backend_write(&ctx->backend, 0x1000, src, 1);
     assert(rc == 0);
     rc = memcmp(src, map, sizeof(src));
     assert(rc == 0);
 
     src[1] = 0xff;
-    rc = flash_write(ctx, 0x1000 + 1, &src[1], 1);
+    rc = backend_write(&ctx->backend, 0x1000 + 1, &src[1], 1);
     assert(rc == 0);
     rc = memcmp(src, map, sizeof(src));
     assert(rc == 0);
 
     src[2] = 0xff;
-    rc = flash_write(ctx, 0x1000 + 2, &src[2], 1);
+    rc = backend_write(&ctx->backend, 0x1000 + 2, &src[2], 1);
     assert(rc == 0);
     rc = memcmp(src, map, sizeof(src));
     assert(rc == 0);
 
     /* Writes past the end of the partition should fail */
-    rc = flash_write(ctx, 0x1000 + 0xff9, src, sizeof(src));
+    rc = backend_write(&ctx->backend, 0x1000 + 0xff9, src, sizeof(src));
     assert(rc < 0);
 
     /* Check that RW file is unmodified after the bad write */