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 D2586C77B73 for ; Sun, 4 Jun 2023 22:12:24 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3F6BC8478D; Mon, 5 Jun 2023 00:12:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinet.cat 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 1CAF88474B; Mon, 5 Jun 2023 00:12:20 +0200 (CEST) Received: from mx1.tinet.cat (mx1.tinet.org [195.77.216.146]) (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 99449847C7 for ; Mon, 5 Jun 2023 00:12:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinet.cat Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xdrudis@tinet.cat X-ASG-Debug-ID: 1685916732-163e7b5c031cc920001-4l7tJC Received: from smtp01.tinet.cat (smtp.tinet.org [195.77.216.131]) by mx1.tinet.cat with ESMTP id BPHeEZNmCtXLhKE8; Mon, 05 Jun 2023 00:12:12 +0200 (CEST) X-Barracuda-Envelope-From: xdrudis@tinet.cat X-Barracuda-Effective-Source-IP: smtp.tinet.org[195.77.216.131] X-Barracuda-Apparent-Source-IP: 195.77.216.131 Received: from xdrudis.tinet.cat (180.red-79-152-181.dynamicip.rima-tde.net [79.152.181.180]) by smtp01.tinet.cat (Postfix) with ESMTPSA id 94C12605D080; Mon, 5 Jun 2023 00:12:12 +0200 (CEST) Date: Mon, 5 Jun 2023 00:12:03 +0200 From: Xavier Drudis Ferran To: Marek Vasut Cc: Xavier Drudis Ferran , u-boot@lists.denx.de, Simon Glass , Philipp Tomsich , Kever Yang , Lukasz Majewski , Sean Anderson , Christoph Fritz , Jagan Teki Subject: Re: [PATCH v6 1/2] arm: dts: rockchip: rk3399: usb: ehci: Fix EHCI probe in rk3399 to access peripherals by USB 2. Message-ID: X-ASG-Orig-Subj: Re: [PATCH v6 1/2] arm: dts: rockchip: rk3399: usb: ehci: Fix EHCI probe in rk3399 to access peripherals by USB 2. References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Barracuda-Connect: smtp.tinet.org[195.77.216.131] X-Barracuda-Start-Time: 1685916732 X-Barracuda-URL: https://webmail.tinet.cat:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 1980 X-Barracuda-BRTS-Status: 1 X-Barracuda-Bayes: SPAM GLOBAL 0.9726 1.0000 4.0267 X-Barracuda-Spam-Score: 4.03 X-Barracuda-Spam-Status: No, SCORE=4.03 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=6.0 KILL_LEVEL=8.0 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.109609 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 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.8 at phobos.denx.de X-Virus-Status: Clean Thanks for your feedback. El Sun, Jun 04, 2023 at 11:31:28AM +0200, Marek Vasut deia: > > diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c > > index 55e1dbcfef..2f31350134 100644 > > --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c > > +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c > > @@ -7,7 +7,7 @@ > > */ > > #include > > -#include > > +#include > > #include > > #include > > #include > > @@ -168,6 +168,9 @@ static struct phy_ops rockchip_usb2phy_ops = { > > .of_xlate = rockchip_usb2phy_of_xlate, > > }; > > +static struct clk_ops rockchip_usb2phy_clk_ops = { > > +}; > > + > > static int rockchip_usb2phy_probe(struct udevice *dev) > > { > > struct rockchip_usb2phy *priv = dev_get_priv(dev); > > @@ -249,6 +252,18 @@ static int rockchip_usb2phy_bind(struct udevice *dev) > > } > > } > > + if (!ret) { > > Can $ret ever be != 0 here ? > No, you're right. I can get rid of the if in v7. > btw. the dev_for_each_subnode() above is missing error handling, in case > device_bind_driver_to_node() there returns non-zero, there should be some > 'goto err' and 'err: dev_for_each_subnode() device_unbind()' fail path. > > > + node = dev_ofnode(dev); > > + name = ofnode_get_name(node); > > + dev_dbg(dev, "clk for node %s\n", name); > > + ret = device_bind_driver_to_node(dev, "rockchip_usb2phy_clock", > > + name, node, &usb2phy_dev); > > + if (ret) { > > + dev_err(dev, > > + "'%s' cannot bind 'rockchip_usb2phy_clock'\n", name); > > Use device_unbind() in fail path here too. > Well, dev_for_each_subnode wouldn't give me the dev to pass to device_unbind, but I can simply call device_chld_unbind(dev) on the error path (on the parent device) and that should clean up any bound children. I'll fix it in v7, thanks.