Skip to content
Snippets Groups Projects
Commit 39388aeb authored by Faiz Abbas's avatar Faiz Abbas Committed by Lokesh Vutla
Browse files

spl: usb: Only init usb once


usb_init() may be called multiple times for fetching multiple images
from SPL. Skip reinitializing USB if its already been done

Signed-off-by: default avatarFaiz Abbas <faiz_abbas@ti.com>
parent c3ab97c1
No related branches found
No related tags found
No related merge requests found
......@@ -22,11 +22,16 @@ int spl_usb_load(struct spl_image_info *spl_image,
struct spl_boot_device *bootdev, int partition,
const char *filename)
{
int err;
int err = 0;
struct blk_desc *stor_dev;
static bool usb_init_pending = true;
if (usb_init_pending) {
usb_stop();
err = usb_init();
usb_init_pending = false;
}
usb_stop();
err = usb_init();
if (err) {
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("%s: usb init failed: err - %d\n", __func__, err);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment