windows: Rename write_from_window* to window_flush*

Change-Id: I17b3457c1689114e76652632358faca3a5130d9d
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/mboxd_msg.c b/mboxd_msg.c
index 5eae6d6..1fd29f7 100644
--- a/mboxd_msg.c
+++ b/mboxd_msg.c
@@ -587,7 +587,7 @@
 				offset = i;
 				count++;
 			} else { /* Change in streak type */
-				rc = write_from_window(context, offset, count,
+				rc = window_flush(context, offset, count,
 						       prev);
 				if (rc < 0) {
 					return rc;
@@ -597,7 +597,7 @@
 			}
 		} else {
 			if (prev != WINDOW_CLEAN) { /* End of a streak */
-				rc = write_from_window(context, offset, count,
+				rc = window_flush(context, offset, count,
 						       prev);
 				if (rc < 0) {
 					return rc;
@@ -610,7 +610,7 @@
 	}
 
 	if (prev != WINDOW_CLEAN) { /* Still the last streak to write */
-		rc = write_from_window(context, offset, count, prev);
+		rc = window_flush(context, offset, count, prev);
 		if (rc < 0) {
 			return rc;
 		}
diff --git a/windows.c b/windows.c
index 921e06f..a9031d6 100644
--- a/windows.c
+++ b/windows.c
@@ -140,12 +140,12 @@
 /* Write from Window Functions */
 
 /*
- * write_from_window_v1() - Handle writing when erase and block size differ
+ * window_flush_v1() - Handle writing when erase and block size differ
  * @context:		The mbox context pointer
  * @offset_bytes:	The offset in the current window to write from (bytes)
  * @count_bytes:	Number of bytes to write
  *
- * Handle a write_from_window for dirty memory when block_size is less than the
+ * Handle a window_flush for dirty memory when block_size is less than the
  * flash erase size
  * This requires us to be a bit careful because we might have to erase more
  * than we want to write which could result in data loss if we don't have the
@@ -154,7 +154,7 @@
  *
  * Return:	0 on success otherwise negative error code
  */
-int write_from_window_v1(struct mbox_context *context,
+int window_flush_v1(struct mbox_context *context,
 			 uint32_t offset_bytes, uint32_t count_bytes)
 {
 	int rc;
@@ -267,7 +267,7 @@
 }
 
 /*
- * write_from_window() - Write back to the flash from the current window
+ * window_flush() - Write back to the flash from the current window
  * @context:		The mbox context pointer
  * @offset_bytes:	The offset in the current window to write from (blocks)
  * @count_bytes:	Number of blocks to write
@@ -275,7 +275,7 @@
  *
  * Return:	0 on success otherwise negative error code
  */
-int write_from_window(struct mbox_context *context, uint32_t offset,
+int window_flush(struct mbox_context *context, uint32_t offset,
 		      uint32_t count, uint8_t type)
 {
 	int rc;
@@ -299,7 +299,7 @@
 		 */
 		if (log_2(context->mtd_info.erasesize) !=
 						context->block_size_shift) {
-			return write_from_window_v1(context, offset_bytes,
+			return window_flush_v1(context, offset_bytes,
 						    count_bytes);
 		}
 		flash_offset = context->current->flash_offset + offset_bytes;
diff --git a/windows.h b/windows.h
index 002e507..dae8bd1 100644
--- a/windows.h
+++ b/windows.h
@@ -13,9 +13,9 @@
 int windows_init(struct mbox_context *context);
 void windows_free(struct mbox_context *context);
 /* Write From Window Functions */
-int write_from_window_v1(struct mbox_context *context,
+int window_flush_v1(struct mbox_context *context,
 			 uint32_t offset_bytes, uint32_t count_bytes);
-int write_from_window(struct mbox_context *context, uint32_t offset,
+int window_flush(struct mbox_context *context, uint32_t offset,
 		      uint32_t count, uint8_t type);
 /* Window Management Functions */
 void alloc_window_dirty_bytemap(struct mbox_context *context);