From patchwork Wed Apr 22 10:50:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Ferraris X-Patchwork-Id: 1274943 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=collabora.com Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 496d2j4tY7z9sSK for ; Wed, 22 Apr 2020 21:08:13 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4D92E81CA3; Wed, 22 Apr 2020 13:06:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 2BA0E81C53; Wed, 22 Apr 2020 12:51:03 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 468088006B for ; Wed, 22 Apr 2020 12:51:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=collabora.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=arnaud.ferraris@collabora.com Received: from xps.home (unknown [IPv6:2a01:e35:2fb5:1510:69a0:4a99:f445:21f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: aferraris) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 616212A073A; Wed, 22 Apr 2020 11:50:59 +0100 (BST) From: Arnaud Ferraris To: u-boot@lists.denx.de Cc: Sjoerd Simons , Adrian Ratiu , Kever Yang , Marek Vasut , Simon Glass Subject: [PATCH 1/2] drivers: usb: musb: Fail if the ctrl mod register is missing Date: Wed, 22 Apr 2020 12:50:25 +0200 Message-Id: <20200422105027.89221-1-arnaud.ferraris@collabora.com> X-Mailer: git-send-email 2.26.1 MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 22 Apr 2020 13:06:11 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 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.102.2 at phobos.denx.de X-Virus-Status: Clean From: Sjoerd Simons If the trcl mode register address cannot be found error out rather then trying to continue (which cannot work) Signed-off-by: Sjoerd Simons Signed-off-by: Arnaud Ferraris --- drivers/usb/musb-new/ti-musb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/usb/musb-new/ti-musb.c b/drivers/usb/musb-new/ti-musb.c index 608facefa3..4e88652433 100644 --- a/drivers/usb/musb-new/ti-musb.c +++ b/drivers/usb/musb-new/ti-musb.c @@ -91,6 +91,11 @@ static int ti_musb_ofdata_to_platdata(struct udevice *dev) phys = fdtdec_lookup_phandle(fdt, node, "phys"); ctrl_mod = fdtdec_lookup_phandle(fdt, phys, "ti,ctrl_mod"); platdata->ctrl_mod_base = (void *)fdtdec_get_addr(fdt, ctrl_mod, "reg"); + if (platdata->ctrl_mod_base == FDT_ADDR_T_NONE) { + pr_err("MUSB ctrl mod missing\n"); + return -ENOENT; + } + usb_index = ti_musb_get_usb_index(node); switch (usb_index) { case 1: