[PATCH 3/4] usbgadget: only set to peripheral mode when error checking is done

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Only begin to modify the hardware when the obious errors have been
checked.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 drivers/usb/gadget/autostart.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/autostart.c b/drivers/usb/gadget/autostart.c
index a27be899c3..2ca979057e 100644
--- a/drivers/usb/gadget/autostart.c
+++ b/drivers/usb/gadget/autostart.c
@@ -39,8 +39,6 @@ static int usbgadget_autostart(void)
 	if (!autostart)
 		return 0;
 
-	setenv("otg.mode", "peripheral");
-
 	opts = xzalloc(sizeof(*opts));
 	opts->release = usb_multi_opts_release;
 
@@ -60,6 +58,8 @@ static int usbgadget_autostart(void)
 		return 0;
 	}
 
+	setenv("otg.mode", "peripheral");
+
 	ret = usb_multi_register(opts);
 	if (ret)
 		usb_multi_opts_release(opts);
-- 
2.11.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux