summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2019-12-30 07:19:12 +0300
committerSimon Glass <sjg@chromium.org>2020-01-08 02:02:38 +0300
commit1058eec0f4a34a28095276729d390885d468a44f (patch)
tree27510969a4a589b1295f9011291c23ec39400cf4 /drivers/usb/gadget
parent6de16dbe44be65946d56eff42263fd799336a9e6 (diff)
downloadu-boot-1058eec0f4a34a28095276729d390885d468a44f.tar.xz
usb: Drop use of BUG_ON() and WARN_ON()
These macros use __FILE__ which inserts the full path of the object file into U-Boot, thus increasing file size. Drop these usages. An older version of this patch was submitted here: http://patchwork.ozlabs.org/patch/1205784/ Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/composite.c4
-rw-r--r--drivers/usb/gadget/f_mass_storage.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index c98a444245..4a6f4271d5 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -1003,7 +1003,11 @@ static void composite_unbind(struct usb_gadget *gadget)
* so there's no i/o concurrency that could affect the
* state protected by cdev->lock.
*/
+#ifdef __UBOOT__
+ assert_noisy(!cdev->config);
+#else
BUG_ON(cdev->config);
+#endif
while (!list_empty(&cdev->configs)) {
c = list_first_entry(&cdev->configs,
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
index 45c7b58eed..c1e6506659 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -390,7 +390,11 @@ static inline int __fsg_is_set(struct fsg_common *common,
if (common->fsg)
return 1;
ERROR(common, "common->fsg is NULL in %s at %u\n", func, line);
+#ifdef __UBOOT__
+ assert_noisy(false);
+#else
WARN_ON(1);
+#endif
return 0;
}