mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-29 07:33:29 +08:00
dfu:core: Find DFU alt setting number by passing its name
New function - dfu_get_alt() - has been added to dfu core. If present, it returns alt setting's number corresponding to passed name. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
This commit is contained in:
parent
57ffabe371
commit
fed936ed80
@ -440,3 +440,15 @@ struct dfu_entity *dfu_get_entity(int alt)
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int dfu_get_alt(char *name)
|
||||
{
|
||||
struct dfu_entity *dfu;
|
||||
|
||||
list_for_each_entry(dfu, &dfu_list, list) {
|
||||
if (!strncmp(dfu->name, name, strlen(dfu->name)))
|
||||
return dfu->alt;
|
||||
}
|
||||
|
||||
return -ENODEV;
|
||||
}
|
||||
|
@ -126,6 +126,7 @@ const char *dfu_get_layout(enum dfu_layout l);
|
||||
struct dfu_entity *dfu_get_entity(int alt);
|
||||
char *dfu_extract_token(char** e, int *n);
|
||||
void dfu_trigger_reset(void);
|
||||
int dfu_get_alt(char *name);
|
||||
bool dfu_reset(void);
|
||||
int dfu_init_env_entities(char *interface, int dev);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user