diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2017-09-27 12:25:17 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-09-27 14:02:20 +0200 |
commit | a3976c3a84f204b005835dd6b358d72b18eeffa3 (patch) | |
tree | 728bf6f0281f67b54ad00fe02361f607a14a2c8c | |
parent | d1ccb5df97750f0aa61bb70b173bfdfbbe4f0d6b (diff) | |
download | barebox-a3976c3a84f204b005835dd6b358d72b18eeffa3.tar.gz barebox-a3976c3a84f204b005835dd6b358d72b18eeffa3.tar.xz |
usbgadget: fastboot: Use function to find file_list entry by name
We have file_list_entry_by_name() now, so use it rather than open
coding it.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/usb/gadget/f_fastboot.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index 598637619d..0f2c02ee47 100644 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -679,18 +679,15 @@ static void cb_flash(struct usb_ep *ep, struct usb_request *req, const char *cmd fastboot_tx_print(f_fb, "INFOCopying file to %s...", cmd); - file_list_for_each_entry(f_fb->files, fentry) { - if (!strcmp(cmd, fentry->name)) { - filename = fentry->filename; - break; - } - } + fentry = file_list_entry_by_name(f_fb->files, cmd); - if (!filename) { + if (!fentry) { fastboot_tx_print(f_fb, "FAILNo such partition: %s", cmd); return; } + filename = fentry->filename; + if (filetype == filetype_ubi) { int fd; struct mtd_info_user meminfo; |