From 2f83f219bfd42bc6ac54689cf4189bd239ed41fe Mon Sep 17 00:00:00 2001 From: Jassi Brar Date: Fri, 6 Apr 2018 12:05:09 +0530 Subject: fastboot: sparse: make write_sparse_image useable for non-fastboot write_sparse_image could be useful for non-fastboot users. For ex a platform, without usb-device/fastboot support, could get sparse images over tftp and write using the mmc command. Or non-android systems could also leverage the sparse format. Towards that, this patch removes anything fastboot specific from the write_sparse_image implementation. Which includes making the function return integer as error code and calls for fastboot logging via an optional callback function 'mssg'. Signed-off-by: Jassi Brar --- include/image-sparse.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/image-sparse.h') diff --git a/include/image-sparse.h b/include/image-sparse.h index 72f4036d81..f39dc16617 100644 --- a/include/image-sparse.h +++ b/include/image-sparse.h @@ -22,6 +22,8 @@ struct sparse_storage { lbaint_t (*reserve)(struct sparse_storage *info, lbaint_t blk, lbaint_t blkcnt); + + void (*mssg)(const char *str); }; static inline int is_sparse_image(void *buf) @@ -35,5 +37,5 @@ static inline int is_sparse_image(void *buf) return 0; } -void write_sparse_image(struct sparse_storage *info, const char *part_name, - void *data); +int write_sparse_image(struct sparse_storage *info, const char *part_name, + void *data); -- cgit v1.2.3