[U-Boot] [PATCH v2 03/10] dfu:core: Export dfu_{get|free}_buf functions

Lukasz Majewski l.majewski at samsung.com
Tue Oct 8 14:30:39 CEST 2013


Define the dfu_get_buf() and dfu_free_buf() as global functions.
They are necessary for zero copy buffer management, when DFU backend is
used for storing data.

Signed-off-by: Lukasz Majewski <l.majewski at samsung.com>

---
Changes for v2:
- None

 drivers/dfu/dfu.c |    4 ++--
 include/dfu.h     |    2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
index 4ec330c..4a8804e 100644
--- a/drivers/dfu/dfu.c
+++ b/drivers/dfu/dfu.c
@@ -67,14 +67,14 @@ int dfu_init_env_entities(char *interface, int dev)
 static unsigned char *dfu_buf;
 static unsigned long dfu_buf_size = CONFIG_SYS_DFU_DATA_BUF_SIZE;
 
-static unsigned char *dfu_free_buf(void)
+unsigned char *dfu_free_buf(void)
 {
 	free(dfu_buf);
 	dfu_buf = NULL;
 	return dfu_buf;
 }
 
-static unsigned char *dfu_get_buf(void)
+unsigned char *dfu_get_buf(void)
 {
 	char *s;
 
diff --git a/include/dfu.h b/include/dfu.h
index b144255..cc14044 100644
--- a/include/dfu.h
+++ b/include/dfu.h
@@ -129,6 +129,8 @@ void dfu_trigger_reset(void);
 int dfu_get_alt(char *name);
 bool dfu_reset(void);
 int dfu_init_env_entities(char *interface, int dev);
+unsigned char *dfu_get_buf(void);
+unsigned char *dfu_free_buf(void);
 
 int dfu_read(struct dfu_entity *de, void *buf, int size, int blk_seq_num);
 int dfu_write(struct dfu_entity *de, void *buf, int size, int blk_seq_num);
-- 
1.7.10.4



More information about the U-Boot mailing list