phy: tegra: fix device-tree node lookups
authorJohan Hovold <johan@kernel.org>
Wed, 15 Nov 2017 09:43:16 +0000 (10:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Jan 2018 19:31:15 +0000 (20:31 +0100)
commitf3f5fa872d09109edfd7c10c57865301fee396d4
tree3ef6690a6ed7d93ceddcb8b89f9bddf518ea09b0
parentd87f1bc7d15b89bd3bcf31020eb7f3b3cd6f84b5
phy: tegra: fix device-tree node lookups

commit 046046737bd35bed047460f080ea47e186be731e upstream.

Fix child-node lookups during probe, which ended up searching the whole
device tree depth-first starting at the parents rather than just
matching on their children.

To make things worse, some parent nodes could end up being being
prematurely freed (by tegra_xusb_pad_register()) as
of_find_node_by_name() drops a reference to its first argument.

Fixes: 53d2a715c240 ("phy: Add Tegra XUSB pad controller support")
Cc: Thierry Reding <treding@nvidia.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/phy/tegra/xusb.c