From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9D842C433EF for ; Mon, 17 Jan 2022 14:12:37 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 36FA2831B5; Mon, 17 Jan 2022 15:12:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=akkea.ca Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=akkea.ca header.i=@akkea.ca header.b="gw4A6FcY"; dkim=pass (1024-bit key) header.d=akkea.ca header.i=@akkea.ca header.b="gw4A6FcY"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BAF0E830DC; Mon, 17 Jan 2022 15:12:33 +0100 (CET) Received: from node.akkea.ca (li1434-30.members.linode.com [45.33.107.30]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3367C8343B for ; Mon, 17 Jan 2022 15:12:30 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=akkea.ca Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=angus@akkea.ca Received: from localhost (localhost [127.0.0.1]) by node.akkea.ca (Postfix) with ESMTP id DB7424E200E; Mon, 17 Jan 2022 14:12:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1642428748; bh=iuLCghp88NgYkYIoFaydsDk3Y2YUVSIBQM8ONYVGrko=; h=From:To:Cc:Subject:Date; b=gw4A6FcYE4lYMix6ZLL8w8fDvf7coJcDR95AMJkYA+xRHjSxnWzGlQ4S20MwCk1cZ +Ekye9YyQaA8i7OWOAo3Gzv1rOFmBllOYimcjBuI4MdtCJF+c5+pTRlrru3I+aqPx4 XTiSPCsuIyLo3bBs4RBMxLiaFn8NaWd/06tZe5po= Received: from node.akkea.ca ([127.0.0.1]) by localhost (mail.akkea.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6DLqRN470Rt1; Mon, 17 Jan 2022 14:12:28 +0000 (UTC) Received: from midas.localdomain (S0106788a2041785e.gv.shawcable.net [24.108.106.191]) by node.akkea.ca (Postfix) with ESMTPSA id EAEF54E2003; Mon, 17 Jan 2022 14:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akkea.ca; s=mail; t=1642428748; bh=iuLCghp88NgYkYIoFaydsDk3Y2YUVSIBQM8ONYVGrko=; h=From:To:Cc:Subject:Date; b=gw4A6FcYE4lYMix6ZLL8w8fDvf7coJcDR95AMJkYA+xRHjSxnWzGlQ4S20MwCk1cZ +Ekye9YyQaA8i7OWOAo3Gzv1rOFmBllOYimcjBuI4MdtCJF+c5+pTRlrru3I+aqPx4 XTiSPCsuIyLo3bBs4RBMxLiaFn8NaWd/06tZe5po= From: Angus Ainslie To: "NXP i.MX U-Boot Team" , u-boot@lists.denx.de Cc: kernel@puri.sm, Angus Ainslie Subject: [PATCH] spl: spl_sdp: don't call board_usb_init twice Date: Mon, 17 Jan 2022 06:11:46 -0800 Message-Id: <20220117141145.206012-1-angus@akkea.ca> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean When CONFIG_DM_USB is not defined then usb_gadget_initialize is just a call to board_usb_init. Calling board_usb_init twice causes the USB to fail so make sure the second invocation is not compiled in when CONFIG_DM_USB is not defined. Signed-off-by: Angus Ainslie --- common/spl/spl_sdp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/spl/spl_sdp.c b/common/spl/spl_sdp.c index ae9c09883a..2a2bc8475d 100644 --- a/common/spl/spl_sdp.c +++ b/common/spl/spl_sdp.c @@ -17,7 +17,8 @@ static int spl_sdp_load_image(struct spl_image_info *spl_image, int ret; const int controller_index = CONFIG_SPL_SDP_USB_DEV; - usb_gadget_initialize(controller_index); + if (IS_ENABLED(CONFIG_DM_USB)) + usb_gadget_initialize(controller_index); board_usb_init(0, USB_INIT_DEVICE); -- 2.25.1