U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Xavier Drudis Ferran <xdrudis@tinet.cat>
To: Marek Vasut <marex@denx.de>
Cc: Xavier Drudis Ferran <xdrudis@tinet.cat>,
	u-boot@lists.denx.de, Simon Glass <sjg@chromium.org>,
	Philipp Tomsich <philipp.tomsich@vrull.eu>,
	Kever Yang <kever.yang@rock-chips.com>,
	Lukasz Majewski <lukma@denx.de>,
	Sean Anderson <seanga2@gmail.com>,
	Christoph Fritz <chf.fritz@googlemail.com>,
	Jagan Teki <jagan@amarulasolutions.com>
Subject: Re: [PATCH v6 1/2] arm: dts: rockchip: rk3399: usb: ehci: Fix EHCI probe in rk3399 to access peripherals by USB 2.
Date: Mon, 5 Jun 2023 00:12:03 +0200	[thread overview]
Message-ID: <ZH0MM8bWUVvd8edf@xdrudis.tinet.cat> (raw)
In-Reply-To: <eb1a1692-3f8e-e470-5458-821aef94f791@denx.de>


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 <common.h>
> > -#include <clk.h>
> > +#include <clk-uclass.h>
> >   #include <dm.h>
> >   #include <asm/global_data.h>
> >   #include <dm/device_compat.h>
> > @@ -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.


  reply	other threads:[~2023-06-04 22:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-04  8:12 [PATCH v6 0/2] arm: dts: rockchip: rk3399: usb: ehci: Fix EHCI probe in rk3399 to access peripherals by USB 2 Xavier Drudis Ferran
2023-06-04  8:13 ` [PATCH v6 1/2] " Xavier Drudis Ferran
2023-06-04  9:31   ` Marek Vasut
2023-06-04 22:12     ` Xavier Drudis Ferran [this message]
2023-06-04  8:13 ` [PATCH v6 2/2] arm: rk3399: usb2phy: phy-rockchip-inno-usb2.c: Implement operations for the 480MHz usb2phy clock in rk3399 Xavier Drudis Ferran
2023-06-04  9:33   ` Marek Vasut
2023-06-04 22:30     ` Xavier Drudis Ferran
2023-06-05  2:41 ` [PATCH v6 0/2] arm: dts: rockchip: rk3399: usb: ehci: Fix EHCI probe in rk3399 to access peripherals by USB 2 Jagan Teki
2023-06-05 15:21   ` Xavier Drudis Ferran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZH0MM8bWUVvd8edf@xdrudis.tinet.cat \
    --to=xdrudis@tinet.cat \
    --cc=chf.fritz@googlemail.com \
    --cc=jagan@amarulasolutions.com \
    --cc=kever.yang@rock-chips.com \
    --cc=lukma@denx.de \
    --cc=marex@denx.de \
    --cc=philipp.tomsich@vrull.eu \
    --cc=seanga2@gmail.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox