Hi Fabrizio-san, Thank you for the patch! > From: Fabrizio Castro, Sent: Friday, March 1, 2019 8:06 PM > > There are cases where multiple device tree nodes point to the > same phy node by means of the "phys" property, but we should > only consider those nodes that are marked as available rather > than just any node. > > Fixes: 98bfb3946695 ("usb: of: add an api to get dr_mode by the phy node") > Cc: stable@xxxxxxxxxxxxxxx # v4.4+ > Signed-off-by: Fabrizio Castro <fabrizio.castro@xxxxxxxxxxxxxx> > --- I'm guessing this code needs for phy-rcar-gen3-usb2.c only because the phy driver only gets the dr_mode from index 0 like below: channel->dr_mode = of_usb_get_dr_mode_by_phy(dev->of_node, 0); Yesterday, I submitted patches to get multiple indexes from controller device nodes: https://patchwork.kernel.org/project/linux-renesas-soc/list/?series=99561 So, would you check the phy patches can get the dr_mode without this changing common patch? Best regards, Yoshihiro Shimoda > drivers/usb/common/common.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/usb/common/common.c b/drivers/usb/common/common.c > index 48277bb..73c8e65 100644 > --- a/drivers/usb/common/common.c > +++ b/drivers/usb/common/common.c > @@ -145,6 +145,8 @@ enum usb_dr_mode of_usb_get_dr_mode_by_phy(struct device_node *np, int arg0) > > do { > controller = of_find_node_with_property(controller, "phys"); > + if (!of_device_is_available(controller)) > + continue; > index = 0; > do { > if (arg0 == -1) { > -- > 2.7.4