diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-03-19 12:02:41 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-03-28 10:52:55 +0200 |
commit | a19926ae60d8cc43d400c0cb3a73875bd98bcdd8 (patch) | |
tree | 644089e42bbe35ad0b308ad9526a5c7eb620b9dc /common/usbgadget.c | |
parent | 26dc1bf751724540716a4a17a80f7605ebf61b3a (diff) | |
download | barebox-a19926ae60d8cc43d400c0cb3a73875bd98bcdd8.tar.gz barebox-a19926ae60d8cc43d400c0cb3a73875bd98bcdd8.tar.xz |
usb: gadget: implement and use system_partitions_get_null
system_partitions_get() clones the system partitions file list and
returns the copy. usb multi gadget code expects disabled gadgets to
have a NULL file list, not an empty one, so fastboot and DFU handle
this case. Add a new system_partitions_get_null helper that can be
used instead. This will be used for USB mass storage gadget as well
in a follow-up commit.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220319110246.2850396-2-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/usbgadget.c')
-rw-r--r-- | common/usbgadget.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/common/usbgadget.c b/common/usbgadget.c index e8c9f7d236..92e4861995 100644 --- a/common/usbgadget.c +++ b/common/usbgadget.c @@ -27,9 +27,7 @@ static inline struct file_list *get_dfu_function(void) { if (dfu_function && *dfu_function) return file_list_parse_null(dfu_function); - if (!system_partitions_empty()) - return system_partitions_get(); - return NULL; + return system_partitions_get_null(); } int usbgadget_register(const struct usbgadget_funcs *funcs) |