summaryrefslogtreecommitdiff
path: root/drivers/dfu
diff options
context:
space:
mode:
authorPrzemyslaw Marczak <p.marczak@samsung.com>2014-02-28 18:53:37 +0100
committerMinkyu Kang <mk7.kang@samsung.com>2014-03-13 10:30:56 +0900
commitb627eb461bb281a00b543e72e74edc197b5f7b5e (patch)
tree3e285ac246ca01beff7ed5b2d9929bcbfc1a7721 /drivers/dfu
parent18f3e0eb4fa5964b0e916005148d8ffbe7694f69 (diff)
downloadu-boot-b627eb461bb281a00b543e72e74edc197b5f7b5e.tar.gz
usb: dfu: add static alt num count in dfu_config_entities()
Thanks to this multiple call of function dfu_config_entities() gives continuous dfu alt numbering until call dfu_free_entities(). This allows to store dfu entities in multiple variables. Signed-off-by: Przemyslaw Marczak <p.marczak@samsung.com> Acked-by: Ɓukasz Majewski <l.majewski@samsung.com> Tested-by: Heiko Schocher <hs@denx.de> Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Diffstat (limited to 'drivers/dfu')
-rw-r--r--drivers/dfu/dfu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/dfu/dfu.c b/drivers/dfu/dfu.c
index 07011e99a8..56e69fd231 100644
--- a/drivers/dfu/dfu.c
+++ b/drivers/dfu/dfu.c
@@ -19,6 +19,7 @@
static bool dfu_reset_request;
static LIST_HEAD(dfu_list);
static int dfu_alt_num;
+static int alt_num_cnt;
bool dfu_reset(void)
{
@@ -377,6 +378,8 @@ void dfu_free_entities(void)
if (t)
free(t);
INIT_LIST_HEAD(&dfu_list);
+
+ alt_num_cnt = 0;
}
int dfu_config_entities(char *env, char *interface, int num)
@@ -394,11 +397,12 @@ int dfu_config_entities(char *env, char *interface, int num)
for (i = 0; i < dfu_alt_num; i++) {
s = strsep(&env, ";");
- ret = dfu_fill_entity(&dfu[i], s, i, interface, num);
+ ret = dfu_fill_entity(&dfu[i], s, alt_num_cnt, interface, num);
if (ret)
return -1;
list_add_tail(&dfu[i].list, &dfu_list);
+ alt_num_cnt++;
}
return 0;