diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2021-05-03 13:48:57 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-05-12 08:00:00 +0200 |
commit | f1dd6339a8d7d62667ba8a1da863319bc5a1dc57 (patch) | |
tree | b2a9a3a75f1ff22c05a2416fe3e8d3311409afbd /drivers | |
parent | eecf05d8ced03ab994cd083c7906df434ffd44b7 (diff) | |
download | barebox-f1dd6339a8d7d62667ba8a1da863319bc5a1dc57.tar.gz barebox-f1dd6339a8d7d62667ba8a1da863319bc5a1dc57.tar.xz |
fastboot/dfu: use system partitions as fall back
Use the new system partitions infrastructure to have fastboot and DFU
fall back to using the same partitions if the global.usbgadget.dfu_function
and global.fastboot_partitions are not set, respectively.
No functional change intended for configurations that have
SYSTEM_PARTITIONS disabled.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20210503114901.13095-13-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/gadget/multi.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c index da4a759117..144ac0624b 100644 --- a/drivers/usb/gadget/multi.c +++ b/drivers/usb/gadget/multi.c @@ -266,6 +266,18 @@ void usb_multi_unregister(void) gadget_multi_opts = NULL; } +unsigned usb_multi_count_functions(struct f_multi_opts *opts) +{ + unsigned count = 0; + + count += !file_list_empty(opts->fastboot_opts.files) || + opts->fastboot_opts.export_bbu; + count += !file_list_empty(opts->dfu_opts.files); + count += opts->create_acm; + + return count; +} + void usb_multi_opts_release(struct f_multi_opts *opts) { file_list_free(opts->fastboot_opts.files); |