From patchwork Tue Feb 12 17:05:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Ratiu X-Patchwork-Id: 1040719 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.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 lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43zTwh4tTQz9s3x for ; Wed, 13 Feb 2019 04:21:56 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 53959C2208E; Tue, 12 Feb 2019 17:21:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 3318AC21FA5; Tue, 12 Feb 2019 17:21:38 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C2CECC21E76; Tue, 12 Feb 2019 17:05:34 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lists.denx.de (Postfix) with ESMTPS id ACB51C21E76 for ; Tue, 12 Feb 2019 17:05:33 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id 2044F27F10E From: Adrian Ratiu To: u-boot@lists.denx.de Date: Tue, 12 Feb 2019 19:05:18 +0200 Message-Id: <20190212170522.27262-1-adrian.ratiu@collabora.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 12 Feb 2019 17:21:36 +0000 Subject: [U-Boot] [PATCH 1/5] drivers: usb: musb: Fail if the ctrl mod register is missing X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" 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 --- 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 20ca2731b49..725086928b3 100644 --- a/drivers/usb/musb-new/ti-musb.c +++ b/drivers/usb/musb-new/ti-musb.c @@ -90,6 +90,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: