mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-04-02 04:21:32 +00:00
dfu: add free_entity() to struct dfu_entity
This allows the backend to free any resources allocated during the relevant dfu_fill_entity_*() call. This will soon be used by the SF backend. Signed-off-by: Stephen Warren <swarren@nvidia.com>
This commit is contained in:
parent
7ac1b410ac
commit
cb7bd2e07e
2 changed files with 5 additions and 0 deletions
|
@ -401,6 +401,7 @@ static int dfu_fill_entity(struct dfu_entity *dfu, char *s, int alt,
|
||||||
|
|
||||||
dfu->alt = alt;
|
dfu->alt = alt;
|
||||||
dfu->max_buf_size = 0;
|
dfu->max_buf_size = 0;
|
||||||
|
dfu->free_entity = NULL;
|
||||||
|
|
||||||
/* Specific for mmc device */
|
/* Specific for mmc device */
|
||||||
if (strcmp(interface, "mmc") == 0) {
|
if (strcmp(interface, "mmc") == 0) {
|
||||||
|
@ -427,6 +428,8 @@ void dfu_free_entities(void)
|
||||||
|
|
||||||
list_for_each_entry_safe_reverse(dfu, p, &dfu_list, list) {
|
list_for_each_entry_safe_reverse(dfu, p, &dfu_list, list) {
|
||||||
list_del(&dfu->list);
|
list_del(&dfu->list);
|
||||||
|
if (dfu->free_entity)
|
||||||
|
dfu->free_entity(dfu);
|
||||||
t = dfu;
|
t = dfu;
|
||||||
}
|
}
|
||||||
if (t)
|
if (t)
|
||||||
|
|
|
@ -110,6 +110,8 @@ struct dfu_entity {
|
||||||
int (*flush_medium)(struct dfu_entity *dfu);
|
int (*flush_medium)(struct dfu_entity *dfu);
|
||||||
unsigned int (*poll_timeout)(struct dfu_entity *dfu);
|
unsigned int (*poll_timeout)(struct dfu_entity *dfu);
|
||||||
|
|
||||||
|
void (*free_entity)(struct dfu_entity *dfu);
|
||||||
|
|
||||||
struct list_head list;
|
struct list_head list;
|
||||||
|
|
||||||
/* on the fly state */
|
/* on the fly state */
|
||||||
|
|
Loading…
Add table
Reference in a new issue