From: Adrian Ratiu Date: Tue, 12 Feb 2019 19:05:18 +0200 Subject: [U-Boot] [PATCH 1/5] drivers: usb: musb: Fail if the ctrl mod register is missing Message-ID: <20190212170522.27262-1-adrian.ratiu@collabora.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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: -- 2.20.1